Home > Net >  Drop down source issues for Apex Form
Drop down source issues for Apex Form

Time:05-24

I have a table I created to use as the source for the of dropdowns of a form. The goal is to have only what possible options are available for the Department code based on who the owner is. I got the scrap owner to display correctly but unfortunately I have not been able for the department code to show up. No options are able to pop up. This is what my code looks like:

    Select DEPT_CODE, DEPT_CODE as Value From Degrade_Robots
    WHERE SO_NAME = :P7_SCRAP_OWNER

    group by DEPT_CODE

    order by DEPT_CODE

My table is set up like: enter image description here

CodePudding user response:

You aren't aggregating anything; don't use group by but distinct.

select distinct
       dept_code as display_value,
       dept_code as return_value
from degrade_robots
where so_name = :P7_SCRAP_OWNER
order by dept_code;

As you don't see anything in the list, I presume that's because you forgot to mention P7_SCRAP_OWNER item in Select List's LoV Parent Item(s) property.

enter image description here

  • Related