Hi All,
I am new to Apex and trying to get around below scenario:
Page1 contains following text fields and select lists
Text Fields
- P1_ENAME
- P1_Job
- P1_Hiredate
Select Lists
Deptno is a select list based on a SQL (SELECT DISTINCT DEPTNO DISPLAY, DEPTNO RETURN FROM EMP;)
P1_MGR is a select list (cascading list with parent as deptno) with SQL (SELECT DISTINCT MGR DISPLAY, MGR RETURN FROM EMP where DEPTNO = :P1_DEPTNO;)
As per my requirement, both deptno and mgr need to be a select list and independent of the text fields.
When P1_DEPTNO is selected, the P1_MGR list works as intended i.e, lists all P1_MGRs that are part of the P1_DEPTNO
Outcome required:
When P1_ENAME is entered, I wish to see the P1_DEPTNO and P1_MGR populated with value that is assigned to the P1_ENAME in the table.
I have a DA for P1_ENAME as below:
Event: Lose Focus
Selection Type: Items
Item: P1_ENAME
Condition: Is not null
Event Scope: Dynamic
True:
Set value
Set type: SQL (SELECT job, deptno, mgr, hiredate FROM emp where ename = :P1_ENAME;)
Page Items to Submit: P1_ENAME
Affected Elements:
Selection type: Items
Items: P1_JOB, P1_DEPTNO, P1_MGR, P1_HIREDATE
Issue:
The P1_DEPTNO is populated as required (ie the P1_DEPTNO for the P1_ENAME), but the P1_MGR list display value is blank. The P1_MGR list does have valid list entries (ie P1_MGR list that belong to the P1_DEPTNO and P1_ENAME)
Could someone please advise how to get the dynamic action to populate the P1_MGR as well or point me in the right direction to get this to work
Hope I made it clear. Please let me know if you require further information or any clarification
The link to the application I created is : https://apex.oracle.com/pls/apex/f?p=97534
Username:demo
Password:demo
Please use P1_ENAME as KING to test
Below is the database record for KING
| EMPNO | ENAME | JOB | MGR | HIREDATE | SAL | COMM | DEPTNO |
|---|
| 7839 | KING | PRESIDENT | 7566 | 11/17/1981 | 5000 | 234 | 10 |
Thank you for your time