Home » Developer & Programmer » Forms » Dynamic Record Group
Dynamic Record Group [message #79475] Thu, 13 June 2002 03:36 Go to next message
sarma
Messages: 6
Registered: November 1998
Junior Member
Hi,

I would like to know how to create and populate record

groups dynamically at runtime?

If anyone explains me with an example that would be

great helpful to me.

Thanks in advance.

Regards,

Sarma
Re: Dynamic Record Group [message #79479 is a reply to message #79475] Thu, 13 June 2002 07:03 Go to previous messageGo to next message
Raymond
Messages: 30
Registered: September 2000
Member
Here goes a short example:
Suppose you have to populate a list dynamically,by selecting from a master.
Then create a list item, say, emp_list_name, in a emp_detail_block.
This list has to be populated from the emp master table.

Put the following code in pre-block/pre-form trigger.
This populates the list.
=======================================================
DECLARE

rg_id RecordGroup;
errcode NUMBER;
BEGIN

if id_null(rg_id) then
rg_id := CREATE_GROUP_FROM_QUERY('REC_GRP','select emp_name,emp_name from emp_master');

errcode := Populate_Group(rg_id);
IF errcode = 0 THEN null;
ELSE
Message('Error creating query record group');
RAISE Form_Trigger_Failure;
END IF;
Clear_List('emp_detail_block.emp_list_name');
Populate_List('emp_detail_block.emp_list_name',rg_id);
end if;
END;

=======================================================

There are other built ins available for adding and deleting to the list dynamically.

caveats:
++++++++
1. I do not know why we need to give at least 2 items in the select. It is not working if i give a single item.Hence, I have repeated emp_name twice.
Re: Dynamic Record Group [message #79497 is a reply to message #79475] Tue, 18 June 2002 00:11 Go to previous messageGo to next message
Subhash
Messages: 105
Registered: October 2001
Senior Member
The first item in the select statement is the value to be displayed and the second, the value to be returned..

regards
Subhash
Re: Dynamic Record Group [message #81285 is a reply to message #79479] Thu, 30 January 2003 03:41 Go to previous message
Jeslie Simpson
Messages: 10
Registered: January 2003
Junior Member
Hi

U need to select 2 items because the first item is considered as the Label and the next as the Value for the List item

U can also give the Label with in Quotes
Previous Topic: Poplist with extraneous spaces
Next Topic: Drawing a button gives 10 buttons
Goto Forum:
  


Current Time: Tue Apr 23 19:42:18 CDT 2024