|How to jump to the parent record in a hierachical table in forms [message #232153]
||Thu, 19 April 2007 11:39
Registered: April 2007
I have a hierarchical table that displays data in an oracle forms environment. All records have requirement ID and parent IDs and the Requirement ID reference parent ID.
Here is a structure of the table.
RQMT_LEVEL----- has levels like 10, 20, 30, 40, 50
PARENT_ID --- references RQMT ID
The way I have designed the form is that , when you double click a record , it takes you to its child records by searching for records that have the same parent ID.
I have a block level triggers that fires when you click on an item i.e.,
:GLOBAL.g_rqmt_id := :REQUIREMENTS_SET.RQMT_ID;
:GLOBAL.g_rqmt_level := :REQUIREMENTS_SET.RQMT_LEVEL;
:GLOBAL.g_record_number := :SYSTEM.TRIGGER_RECORD; --gets the record number of the current record
SET_BLOCK_PROPERTY('REQUIREMENTS_SET', DEFAULT_WHERE, 'parent_id = :GLOBAL.g_rqmt_id');
:GLOBAL.g_rqmt_level = v_max_level
Message('You are at the bottom level');
Now the challenge at hand is that I have a "BACK" button which is supposed to take me back to the previous record where the records came from . The problem is that I am only able to go back one level using a global variable that stores the value of :SYSTEM.TRIGGER_RECORD and use the FIND_RECORD built-in to fetch that. But this only saves the value of the last level. Like in other words I cannot make it remeber the parent of the parent and go back to it without hard coding anything. here is what it does so far...
v_parent_id := :REQUIREMENTS_SET.PARENT_ID;
WHERE rqmt_id= v_parent_id;
:GLOBAL.g_parent_level := v_parent_level;
SET_BLOCK_PROPERTY('REQUIREMENTS_SET', DEFAULT_WHERE, 'rqmt_level = :GLOBAL.g_parent_level');
WHEN OTHERS THEN
Message('You are at the top most level');
Is there a way for me to find a record based on the parent and have it jump to that record and also display other records in that table in that level but just have the cursor move to that one record? I would appreciate any help i can get on this.