problem in forms [message #121388] |
Sat, 28 May 2005 01:38 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
prathibha_1201
Messages: 11 Registered: May 2005
|
Junior Member |
|
|
hello ,
I have 2 fields main_code,sub_code in master table mis_sft_mast and there is a field name_sft(list item in the form) in another table mis_lic_dtls.
Now the problem is when I select main_code and sub_code in the form corresponding to mis_lic_dtls i should display the elements in the list corresponding to selected main_code and sub_code.
for ex: if main_code='sws' and sub_code='os' then
the elements in list item name_sft should be win98,win95.....
please help me in finding answer to this problem.
regards,
prathibha.
|
|
|
|
Re: problem in forms [message #121428 is a reply to message #121388] |
Sat, 28 May 2005 16:59 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) |
danosw
Messages: 20 Registered: May 2005 Location: California
|
Junior Member |
|
|
If I'm understanding your question, you want to populate a list item based on the execution/results in another block.
Then you need to create a record group dynamically and populate the list item with the record group after every query of the master block.
Here's how to do it.
Call the follow in your master block post-query trigger:
GENERIC_POPULATE_LIST('OTHER_BLOCK.NAME_SFT',
'NAME_SFT_REC',
'select name_sft, name_sft from
mis_lic_dtls where
main_code = :master_block.main_code
and sub_code = :master_block.sub_code');
Create the follow procedure:
PROCEDURE GENERIC_POPULATE_LIST(vListName VARCHAR2,
vGroup_Name VARCHAR2,
vQuery VARCHAR2) IS
rg_Name VARCHAR2(100) := vGroup_Name;
rg_id RecordGroup;
errcode NUMBER;
list_id ITEM := FIND_ITEM(vListName);
BEGIN
/*
** Make sure group doesn't already exist
*/
rg_id := Find_Group( rg_Name );
/*
** If it does not exist, create it and add the two
** necessary columns to it.
*/
IF Id_Null(rg_id) THEN
rg_id := Create_Group_From_Query( rg_Name,
vQuery);
END IF;
/*
** Populate the record group
*/
errcode := Populate_Group( rg_id );
Clear_List(list_id);
Populate_List(list_id, rg_Name);
END;
|
|
|