See the following sample code.
Let's say, based on county code you want to populate city list.
If not id_null(group_id) then
/* create the group 'rg_city' and assign its id to the
** variable group_id */
group_id := Create_Group_From_Query ('rg_city', 'SELECT city_name, city_code
WHERE country_code = ' || :block.country_code);
/* now execute the new group's query, using the variable
** group_id to identify the group */
query_ok := Populate_Group(group_id);
/* Populate the list item block.city_name based on block.county_code
Populate_List ('block.city_name', group_id);
Please mark the question as Correct/Answer, if this answers your question. Thanks
What exactly has to be dynamic at runtime? Do you want to show different columns in the lov? or only different data? If it is different data, in waht way is it different? Do you have to apply a different WHERE-condition? Or is the whole query completely different?
Can anyone please tell me how to create dynamic LOV & assign dynamic RG to it on run time according to previous data seletion.
An LOV can only be defined during design. Once created, you can dynamically create and assign the Record Group (RG) that supplies the data to the LOV. This can be a drawback, but it is the way Forms works. If you need different layouts and column mapping from an LOV that is dependent upon choices a user makes during runtime, then you will need to create a seperate LOV for each situation in the Forms Builder. Then you can programatically assign LOV's to an item based on the user's choices as well as create/assign different RG's as needed during runtime.