Home » Developer & Programmer » Forms » problem in forms
problem in forms [message #121388] Sat, 28 May 2005 01:38 Go to next message
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 #121390 is a reply to message #121388] Sat, 28 May 2005 02:16 Go to previous messageGo to next message
weekend79
Messages: 198
Registered: April 2005
Location: Islamabad
Senior Member

Dear prathibha_1201

1st of all learn to define your problem clearly in minimum words.
+ It will even batter if you convert or simulate your problem with well know (demobld “scott/tiger” database) for experts ease / understanding.

Now if you want following. (Considering emp, dept tables)

(step1) Select a dept no

(step2) Then move to next field to select them empno

Now if you want that empno field will show only the empno of persons whose deptno = deptno selected in (step1).

Then do as follow.

1st of all quit list items and adopt lov.

In deptno lov pass query “select distinct deptno from emp;”
In empno lov pass query “select empno from emp where empno = :bockname.itemname;”

/* where bockname = name of block & itemname is the name of itme you used in form for deptno*/

If not understand you can ask again.

Thanks
Jawad
Re: problem in forms [message #121428 is a reply to message #121388] Sat, 28 May 2005 16:59 Go to previous message
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;
Previous Topic: About Browser Window in Oracle Forms Builder 6i
Next Topic: how to execute dynamic query what is the syntax
Goto Forum:
  


Current Time: Wed Sep 18 21:25:27 CDT 2024