dynamic lov [message #164092] |
Tue, 21 March 2006 16:07 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
doc1
Messages: 18 Registered: December 2005
|
Junior Member |
|
|
hi!
I am trying to populate values in lov dynamically.. i have writen code in trigger when-new-record-instance n has attache lov to the item in the block(block manipulate multiple records at same time)..now the problem is wen i entered into new record n click the item instead of appreaing the lov it prompts record must be delted or inserted first and it keeps promting that..can anyone fix this or atleast tell me where is the problem in the code below
DECLARE
all_grp recordgroup;
status NUMBER (3);
fm_id formmodule;
rec_num NUMBER (3);
lst_rec NUMBER (3);
row_count NUMBER (3);
group_rec NUMBER;
cur_all_id VARCHAR2 (15);
BEGIN
all_grp := Find_group ('all_lov');
status := Populate_group (all_grp);
IF status = 0 THEN
fm_id := Find_form (:system.current_form);
Set_form_property (fm_id, validation, property_false);
Go_block ('pvt_all');
rec_num := To_number (:system.cursor_record);
lst_rec := To_number (:system.cursor_record);
first_record;
FOR row_count IN 1 .. lst_rec
LOOP
cur_all_id := :pvt_all.all_id;
group_rec := Get_group_record_number ('all_lov.all_id', cur_all_id);
IF group_rec > 0 THEN
Delete_group_row (all_grp, group_rec);
END IF;
next_record;
END LOOP;
Go_record (rec_num);
END IF;
Set_form_property (fm_id, validation, property_true);
END;
Upd-mod: Next time please format your code so that it is readable! Try http://www.orafaq.com/cgi-bin/sqlformat/pp/utilities/sqlformatter.tpl
[Updated on: Wed, 22 March 2006 00:44] by Moderator Report message to a moderator
|
|
|
|
Re: dynamic lov [message #164265 is a reply to message #164092] |
Wed, 22 March 2006 12:41 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
doc1
Messages: 18 Registered: December 2005
|
Junior Member |
|
|
1. the block is based on table pvt_all(p_id,all_id,all_catgory). now against one p_id there can be multiple all_id but should be unique. Now block can retreive or perform dml at multiple records at same time. so, if user accidently enters all_id into a record that has already been entered into any previous record, data will not be committed on save. so all i am trying to do is to remove those values from lov at run time which has already been entered against that particular p_id.
2. it is not working even after removing go_block statement
|
|
|
|