Providing an example form for creating hierarchical trees in Oracle Forms to control data block records. In this form whenever user selects any node in tree menu then corresponding record is displayed at right side.
This form is having two data blocks, EMP and Control, the control block is having Tree Item and populating that tree on PRE-FORM trigger with the following code:
'SELECT decode(level, 1, 1, -1), level, INITCAP(ename), ''fxrun'',' ||
'empno FROM SCOTT_emp ' ||
'START WITH mgr IS NULL CONNECT BY PRIOR empno = mgr');
And whenever user select any node then the following code is written on When-Tree-Node-Selected trigger to fetch the record for the selected employee:
set_block_property('EMP', DEFAULT_WHERE, 'EMPNO='||
The fxrun.ico icon and table scott_emp is used in this example and script of this table and icon file are available in source code.
Like us to get notifications for free source code in future, thanks.