0
votes

I am using apex 20.1 and try to implement the new cascading lovs option. However it is not working as per expectation.

Can you suggest where am I going wrong.

I have 2 items in my region:

  • :P5_ASSIGNED_DEPT - Assigned department for each employee
  • :P5_PERSON_NAME - Name of employee

I want the name of employees to populate as per assigned dept in table. If assigned_Dept is FINANCE, only employees with assigned dept as finance should populate in :P5_PERSON_NAME.

I made these changes:

enter image description here But despite selecting finance, i am getting names of all employess irrespective of dept.

What more changes are needed?

1

1 Answers

1
votes

I presume that query you used for P5_PERSON_NAME doesn't contain P5_ASSIGNED_DEPT. Apex can't automagically add WHERE clause to your query, you have to do it yourself.

So: P5_PERSON_NAME's LoV query should look like this:

select e.ename as display_value,
       e.id    as return_value
from emp e
where e.dept_id = :P5_ASSIGNED_DEPT