I am trying to loop through all records in all blocks and hit all
items, to check their values/properties. I have a procedure and it
ALMOST seems to work in the following code. However, I think that the
fact of where I am navigating at which time is causing an issue. the
result is that I hit all blocks andd items but not all records in
multi-record blocks. to start, I see in the debugger that
:SYSTEM.last_record has no value. Is this my problem? All help is
appreciated. Thanks very much
BEGIN
cur_frm := :SYSTEM.Current_Form;
cur_blk := Get_Form_Property(cur_frm,FIRST_BLOCK);
lst_blk := Get_Form_Property(cur_frm,LAST_BLOCK);
cur_itm := cur_blk||'.'||Get_Block_Property(cur_blk,FIRST_ITEM);
lst_itm := cur_blk||'.'||Get_Block_Property(cur_blk,LAST_ITEM);
WHILE cur_blk <> lst_blk LOOP--BLOCK--
First_Record;
WHILE :SYSTEM.last_record != 'TRUE'LOOP--RECORD--
WHILE cur_itm <> lst_itm LOOP--ITEM --
My code to be run on every item of every record of every block
in my form
cur_itm := cur_blk||'.'||GET_ITEM_PROPERTY(cur_itm, NEXTITEM);
END LOOP;--ITEM --
NEXT_RECORD;
END LOOP;--RECORD--
cur_blk := GET_BLOCK_PROPERTY(cur_blk, NEXTBLOCK);
cur_itm := cur_blk||'.'||Get_Block_Property(cur_blk,FIRST_ITEM);
lst_itm := cur_blk||'.'||Get_Block_Property(cur_blk,LAST_ITEM);
END LOOP;--BLOCK--
END;
> Is this my problem?
Your problem is you don't understand developer automatically loops
through all records of a multirecord block.
Sybrand Bakker, Senior Oracle DBA
To reply remove -verwijderdit from my e-mail address
GO_BLOCK(cur_blk); << need to add this here
> First_Record;
> WHILE :SYSTEM.last_record != 'TRUE'LOOP--RECORD--
> WHILE cur_itm <> lst_itm LOOP--ITEM --
> My code to be run on every item of every record of every block
> in my form
> cur_itm := cur_blk||'.'||GET_ITEM_PROPERTY(cur_itm, NEXTITEM);
> END LOOP;--ITEM --
> NEXT_RECORD;
> END LOOP;--RECORD--
> cur_blk := GET_BLOCK_PROPERTY(cur_blk, NEXTBLOCK);
> cur_itm := cur_blk||'.'||Get_Block_Property(cur_blk,FIRST_ITEM);
> lst_itm := cur_blk||'.'||Get_Block_Property(cur_blk,LAST_ITEM);
> END LOOP;--BLOCK--
>
> END;
You need to use GO_BLOCK(cur_blk) before FIRST_RECORD to make it the active
block before you start looping through it's records.