Question about NEXT_RECORD built-in and When-Validate-Item trigger
535608Dec 23 2008 — edited Dec 29 2008Hi,
I am working with a form which has/does the following:
1) Has two database blocks ( Block 1 --> Single Record Block & Block 2 ---> Multi Record Block)
2) Has few items in each block.
3) When I fill in the fields on Block 1 and press tab to navigate to go to Block 2, in the key-next-item trigger of an item in Block 1, I have created a timer and when the timer expires, the When-Timer-Expired Trigger at the form level fires, which has a cursor that retrieves data from different database tables and assigns to the items in Block 2 and when saved the form it has to save all the records to the database tables attached to the form blocks.
During this process when I open the cursor and assign the values to each item and say NEXT_RECORD the When-Validate-Item triggers written on each Item level fires and does the validations. The code looks something like this.
WHEN-TIMER-EXPIRED Trigger Code
DECLARE
CURSOR C1
IS
................
................
................
BEGIN
FOR c1_rec in C1
LOOP
:block2.item1 := c1_rec.col1;
:block2.item2 := c1_rec.col2;
:block2.item3 := c1_rec.col3;
message ('Value of item 3 is ' || :block2.item3);
NEXT_RECORD;
END LOOP;
DELETE_RECORD;
POST;
FIRST_RECORD;
END;
So my problem is the value assigned to :block.item3 before NEXT_RECORD call is missing during WHEN-VALIDATE-ITEM Trigger on the same item. I have tried to print the value as soon as the trigger fires. Suppose previous value is "100" the value in the WVI trigger is printed as NULL.
I have tried this many times, but all the times I am getting the same value.
Can anyone help me in identifying the problem?
Thanks for the help & your time