Forum Stats

  • 3,872,223 Users
  • 2,266,407 Discussions
  • 7,911,107 Comments

Discussions

Select List based on values of other form fields

wallysteadman - oracle
wallysteadman - oracle Member Posts: 205
edited Aug 27, 2013 10:12AM in APEX Discussions
Greetings all,
I have a select list that is currently a static list that has the values Open, Working, Closed but I need to make the list populated based on other fields on the form.

So Open and Working always need to be an available option but I only want Closed to appear as an option if 4 other field on the form are NOT blank. Meaning they have vaules.

I have a fields called TimeTaken, EngineerAction, EngineerReason, EngineerAssigned and these all have to contain vailues before Closed shows up as an option in the select list.

If necessary, I can make an LOV list with the values if it makes this easier. I just don't know the correct/appropriate approach.

Any assistance would be appreciated.

Thanks
Wally
Tagged:

Answers

  • Howard (... in Training)
    Howard (... in Training) Member Posts: 905
    edited Feb 4, 2013 1:49PM
    When you construct a select list, one of the examples right there -- below the field "Source: List of Values Query" -- is a "Dynamic List of Values":
    IF :MY_ITEM='10' THEN
      RETURN 
      'SELECT ename, empno 
    FROM  emp 
    WHERE depno = 10 
    ORDER BY 1';
    ELSE
      RETURN 
      'SELECT ename, empno 
    FROM emp 
    WHERE depno = :my_item 
    ORDER BY 1';
    END IF;
    In your case, I believe you'd want
    IF (all by field are null) THEN

    Howard
  • So I created a dynamic list of values and it does work, but it requires me to save the record and then when I go back in it populates the select list properly, but I guess I am not sure how to turn this into a dynamic action where the values of the select list change while they are on the page rather than having to save it.

    My Dynamic select list is created with the following code:
     IF :P104_ENGINEERCLASSIFICATION IS NULL AND :P104_ENGINEERROOTCAUSE IS NULL AND :P104_ESCALATIONTIMETAKEN IS NULL THEN
      RETURN 
      'SELECT LOVNAME, LOVVALUE
    FROM  ESCALATION_LOV 
    WHERE Display = 1';
    ELSE
      RETURN 
      'SELECT LOVNAME, LOVVALUE 
    FROM ESCALATION_LOV';
    Having trouble turning it into a dynamic action. Any assistance would be appreciated.
  • user12180635
    user12180635 Member Posts: 56 Blue Ribbon
    edited Aug 27, 2013 10:12AM

    Hi,

    I have the same requirement as you had, can you post your complete code here.

    It would be appreciate.

    Thanks

This discussion has been closed.