Re: Forms 4.5: where to put code to create new record?

From: Peter Brenner <pbrenner_at_charlotte.infi.net>
Date: 1998/06/15
Message-ID: <6m4j2r$m78$1_at_nw003t.infi.net>#1/1


[Quoted] Why not put the code in a database trigger tied to an Insert on the table. Then you won't have
[Quoted] to try and trap it in the form

Todd Owers wrote in message <01bd98ab$c18cc660$764c1bcc_at_toddo.gcr1.com>...
>
>I have a block of code that I want to execute each time a user adds a new
>record. The problem is that, because of the variety of ways in which a
>user can create a new record in Forms 4.5, I can't figure out where to
>locate the code so that the same body of code gets executed no matter how a
>new record is created.
>
>My application has three ways for the user to create a new record:
>
>1. Select 'Add New Record' from the menu. This invokes
>DO_KEY('CREATE_RECORD').
>2. At the last record, press the Next Record icon on the toolbar. This
>invokes DO_KEY('NEXT_RECORD'), which creates a new record if the current
>record is the last record in the block.
>3. At the last record, press the down arrow key. This invokes the DOWN
>built-in, which also creates a new record if the current record is the last
>record in the block.
>
>At first, I put the code in a Key-Crerec trigger. This trigger fires after
>option #1 above, but not after options 2 or 3. Then, I put the code in a
>When-Create-Record trigger. This trigger fires after options 2 and 3, but
>not after option 1. What gives? I would expect the When-Create-Record
>trigger to fire in all situations when a new record is created, but it does
>not.
>
>Thanks in advance for any suggestions.
>
>Todd Owers
>toddo_at_gcr1.com
Received on Mon Jun 15 1998 - 00:00:00 CEST

Original text of this message