3 Replies Latest reply on Sep 13, 2017 2:49 PM by Roxanne

    Apex 5: default PopUp LOV value

    Roxanne

      Hello All

       

      I am working with Apex 5 and fresh new user

       

      I have a popup LOV list for my ITEM, lets say

      ITEM = P_ID

      LOV = (1,2,3)

       

      I would like that the item has the default value on creation

       

      For example;

      P_ID = 1

       

      From the item properties --> DEFAULT: i have tried all the options (statis, sql, ...) but item is still null on creation

       

      Could you please help me set a default value on my item ?

       

      thank you

      regards

      Roxanne

        • 1. Re: Apex 5: default PopUp LOV value
          Roxanne

          any idea ???

          • 2. Re: Apex 5: default PopUp LOV value
            Q_STEPHENSON

            Hi Roxanne

             

            Try the following example, it might help you understand how it all fits together.

             

            Once you have added a Popup LOV item to your page, create a Popup LOV using the following SQL query.  Not the first column is the displayed text, while the second column it the underlying value:

             

            select 'one' name, 1 val

            from dual

            union all

            select 'two', 2

            from dual

            union all

            select 'three', 3

            from dual

             

            you can either ensure that only values in the list can be used at anytime by setting the "Display Extra Values" to No.

             

            To set the default value, change the Default type to be "PL/SQL Function Body". and add the following code to the PL/SQL Function Body block:

             

            begin

            return 1;

            end;

             

            If you have set the "Display Extra Values" to No, in order for the default fault to display it must be a value that can be found in the result set of the query used for your LOV.   In this example I use a simple block with a return statement returning the number 1 (You can used sql or pl/sql to determine what the value will be).

             

            Hope that helps.

            Q

            • 3. Re: Apex 5: default PopUp LOV value
              Roxanne

              hello

               

              i had to enable 'display extra values'

              no it is workign well when i set a default value

               

              thank you