Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Passing Page ITEM value to a Shared LOV

Wim MeysOct 18 2016 — edited Oct 18 2016

Hi

(using APEX 5.0)

I wonder if its possible to use a SHARED LOV and pass a PAGE ITEM VALUE to it.

This is what I try to accomplish.

All my LOVs are based on a REFERENCE table. The Values can be managed by an APEX page.

So far so good.

In time new values will be added, but existing values could become obsolete.
Meaning:

- existing records using this value obsolete Return Value should display the obsolete Display Value,

- when new records are created, only the active (non-obsolete) values should be displayed (STATUS = Open)

Below:

OPSGROUP with Return Value = 1 and Display Value = KPN has status "Open" and should be visible in LOV at all time.

OPSGROUP with Return Value = 2 and Display Value = TEST has status "Closed" and should only be visible in LOV when I select a record that uses that "obsolete" STATUS_ID = 2

apx5-2.png

I can do this by using an LOV ofd type SQL Query like this:

SELECT display_value, return_value
FROM cfg_ref_codes_v
WHERE NAME = 'OPSGROUP'
AND STATUS_ID = 1
UNION
SELECT display_value, return_value
FROM cfg_ref_codes_v
WHERE NAME = 'OPSGROUP'
AND STATUS_ID = :P13_GROUP_ID
ORDER BY display_value

Regarding the First SELECT:

STATUS_ID = 1 means these are the values with STATUS = Open (may be used).

Regarding the Second SELECT:

Suppose in APEX I select an existing record with a STATUS_ID = 2, then this second select would make sure that my LOV shows Display Value "TEST" instead of Return Value 2.

This works fine.

apx5-1.png

But this is with an LOV based on a SQL Query.

I wonder now if I can pass PAGE ITEM VALUES to a shared LOV.

I'd rather use SHARED LOVs because it's easier to maintain.

Any ideas?

cheers,

Wim

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 15 2016
Added on Oct 18 2016
4 comments
1,558 views