Re: Processing of WHEN-NEW-ITEM-INSTANCE FORMS4.5

From: Steve Cosner <stevec_at_zimmer.CSUFresno.EDU>
Date: 1995/11/27
Message-ID: <DIptF8.MyI_at_CSUFresno.EDU>#1/1


Kevin, this is not a bug. You have programmed an infinite loop. Your go_item to block2, then back to block1.item1 causes the when-new-item-instance trigger attached to block1.item1 to fire over and over again.

Stop trying so hard to read those flow charts, and look what you have written.

If you are trying to do something to block2 each time the cursor enters block1.item1, then you can either:

  1. Do it at the when-new-record-instance trigger or a when-new-block-instance trigger, or
  2. Set a flag (like :Parameter.b2_flag) to prevent the loop:
      Create a parameter named b2_flag with init. value:='not_done'.
      In your b1.item1 wnii trigger, do this--
        if :parameter.b2_flag='not_done' then
          :parameter.b2_flag:='done';
          go_item b2.item1;
          --do what you want there--
          go_item b1.item1;
        else
          :parameter.b2_flag:='not_done';
        end if;

      In the above solution, the wnii trigger fires twice, but only
the first time it goes to b2.item1. The second time, nothing happens, except for changing the value of :parameter.b2_flag.

('wnii' = 'when-new-item-instance')

Hope this helps.
Steve Cosner  

In article <4909lc$8kr_at_dub-news-svc-4.compuserve.com> 100704.1155_at_compuserve.com (Kevin Croocmbe) writes:
>FORMS 4.5.6.0.7

 <snip>
>However, I find this interpretation at odds with the observed
>behavior. I would expect the following trigger to fire just once
>whenever the user navigates ordinarily to block1.item1.
>
>
>WHEN-NEW-ITEM-INSTANCE (attached to block1.item1)
>
>
>begin
>
> go_item('block2.item1');
>
> go_item('block1.item1');
>
>end;
>
>
>However, I find that what actually happens is that the
>form fires the WHEN-NEW-INSTANCE-TRIGGER ad infinitum
> - presumably because the go_item('block1.item1) is
>(unexpectedly) causing the trigger to re-fire!
<snip> Received on Mon Nov 27 1995 - 00:00:00 CET

Original text of this message