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

From: Peter H. Larsen <plarsen_at_dc.dynares.com>
Date: Tue, 16 Jun 1998 15:02:38 -0400
Message-ID: <3586C14E.6A083805_at_dc.dynares.com>


Hi,
You're confusing a few issues in forms ... You want to do something on an event - you create an event trigger. Do NOT try to confuse the navigatable key triggers, because you even left out a few other options the user has to create recrods - ei. using the mouse, which does NOT fire any of the triggers you talk about.

If your problem is you want to do some database access, calculate some figures or find some references, use PRE-INSERT (or sometimes POST-INSERT). If your problem is, you want to do some initial value settings based on computations, you MIGHT want to look at WHEN-NEW-RECORD-INSTANCE. But do not assign values to your record if you use this trigger, otherwise you'll have to use CLEAR_RECORD if the user just navigates to the record by accident. If you want to give "dynamic" default values, you calculate these values, place them in control blocks, and refer to the values in the default_value attribute on the fields. This will prevent the record of changing it's NEW status to CHANGED and you'll be able to navigate out of the incomplete record and discard it without using the clear-record functionality.

It's very important not to confuse these two ways of approaching a problem - as forms is event based, you'll never have a 100% functioning form if you try to program events by using navigational triggers.

  • Peter H. Larsen Oracle Consultant

Todd Owers wrote:
>
> That is a good idea, but the code needs to reside in the application,
> because it consists of Forms 4.5 built-ins.
>
> Todd
>
> Peter Brenner <pbrenner_at_charlotte.infi.net> wrote in article
> <6m4j2r$m78$1_at_nw003t.infi.net>...
> > Why not put the code in a database trigger tied to an Insert on the
> table.
> > Then you won't have
> > to try and trap it in the form
> >
> >
Received on Tue Jun 16 1998 - 21:02:38 CEST

Original text of this message