Skip to Main Content
Feature Request FR-4210
Product Area Shared Components
Status CLOSED

4 Voters

List of Values with parameters.

spijnenb Public
· Jan 17 2025

Idea Summary
List of Values with parameters

Use Case
Think of an simple application with companies and purchase orders. Companies can be active or inactive.
On the order page users can only select an active company in a LOV, which shows the name. Users are also allowed to set a company to inactive in the applicaiton on a different page.
Let's say a user sets Company A to inactive, but this company is linked to purchase order 123. On the page of the purchase order, the LOV fails to display company A and instead show the ID.

The workaround we use is to pass a bind variable, if :P100_COMPANY_ID is already filled, then always show that company in the query., even when inactive. However we cannot re-use the query anymore in shared components, without directly referencing that page item bind variable.

Preferred Solution (Optional)
Please extend the Shared Components LOV to pass bind variables so that we can re-use shared component LOV's and use generic bind variables in LOV queries

This request is likely a duplicate of FR-1988.

Comments

Comments

  • nicolas pilot OP 3 weeks ago

    This is a very common problem that we encounter almost every day. The bind variable is a very good idea.

  • mswvette OP 3 weeks ago

    I use a union that returns the current value used.  I also wrote a function that uses the built-in v function, there is a helper function that builds the page item name from the page id.  your LOV will have 

    select display, return from company_lov where flag = active

    union

    select display, return from where company_id = page_item_value(:app_page_id, ‘COMPANY_ID’)

    function page_item_name(p_page_id                in pls_integer,
    p_item_name                in varchar2,
    p_page_id_prefix            in varchar2    default c_page_field_prefix,
    p_page_id_suffix            in varchar2    default c_page_field_suffix)
    return varchar2 is

    begin
    return upper(p_page_id_prefix||to_char(p_page_id)||p_page_id_suffix||p_item_name);

    end page_item_name;

    --******

    function page_item_value(p_page_id                in pls_integer,
    p_item_name                in varchar2,
    p_null_value                in varchar2    default null,
    p_flow                    in number    default null,
    p_scope                in varchar2    default c_apex_scope,
    p_escape                in varchar2    default c_no_flag,
    p_page_id_prefix            in varchar2    default c_page_field_prefix,
    p_page_id_suffix            in varchar2    default c_page_field_suffix)
    return varchar2 is

    begin
    --** refernce v (apex v function)
    return nvl(v(p_item    => page_item_name(p_page_id, p_item_name, p_page_id_prefix, p_page_id_suffix),
    p_flow    => p_flow,
    p_scope    => p_scope,
    p_escape    => p_escape),
    p_null_value);

    end page_item_value;

  • fac586 OP 3 weeks ago

    Duplicate of FR-1988