Uma Ilango
Uma Ilango

Reputation: 978

Set select list value via PLSQL

I am calling an apex page via URL and pass all item values in the request like

f?p=&APP_ID.:44:&SESSION.:INSERT:&DEBUG.:44:P44_NAME,P44_DESCRIPTION,P44_PARENT_PK_ID:#NAME#,#DESCRIPTION#,#PARENT_PK_ID#_#PK_ID#

In my case I have to check if the row has a parent key reference value. If yes I have to set the parent key reference value to P44_PARENT_PK_ID. Otherwise, I have to set the key reference value (#PK_ID#) to P44_PARENT_PK_ID. That's why I am passing both values split with "_" in the URL.

On page 44 I have a process on the "Before Regions" process point:

DECLARE 
  v_demilitedstring varchar2(100);
BEGIN
   v_demilitedstring := v('P44_PARENT_PK_ID');

   IF nvl(to_number(substr(v_demilitedstring, 1, instr(v_demilitedstring, '_', 1, 1) -1)), 0) = 0 then
        :P44_PARENT_PK_ID := substr(v_demilitedstring, instr(v_demilitedstring, '_', -1, 1) +1);
   ELSE
        :P44_PARENT_PK_ID := substr(v_demilitedstring, 1, instr(v_demilitedstring, '_', 1, 1) -1);
   end if;
END;

I set the success message as &P44_PARENT_PK_ID. to check if the right value is assigned to it. The procedure is working fine and the correct value is set to P44_PARENT_PK_ID. However, the assigned value is not selected in select list (Meaning the display name of value is not displayed).

How can I trigger the select list item to change it's display value?

Upvotes: 0

Views: 2348

Answers (1)

eaolson
eaolson

Reputation: 15094

So it sounds like you have a select list generating correctly and you you want to change the value that is selected when the page loads. For that, go to the Source section of the select list item. You can drive that based on another page item, like P44_PARENT_PK_ID, a query, or a number of other options.

Make sure that the list of values for your select list will have the source value in it.

Upvotes: 1

Related Questions