Re: FORMS 4.5: WHEN-VALIDATE-ITEM TRIGGER

From: Steve Cosner <stevec_at_zimmer.CSUFresno.EDU>
Date: 1996/08/06
Message-ID: <4u8jtv$66c_at_zimmer.CSUFresno.EDU>#1/1


You can determine the Oracle error that causing the insert to fail by pressing the Shift-F1 key. It should tell you what the database error message is.

Also, if no record is found for the kunde.kundenr value, why are you inserting the record at that time. It would be more of a "standard" process to do the record insert when the user presses the commit key?

The method you are using may be attempting to insert a row into the kunde table with nulls or otherwise invalid values into some of the columns.

Hope this helps,
Steve Cosner

In article <estokked.31.000ADAAF_at_sn.no>, Erlend Stokkedal <estokked_at_sn.no> wrote:
>I have a problem, with a application that i'm making, and that is with a
>When-Validate-Item trigger in Forms 4.5. The code is as follow:
>
>BEGIN
> select kundenr, enavn, fnavn, adresse, postnr, psted, kundegruppe,
> regdato
> into :kundeblk.kundenr, :kundeblk.enavn, :kundeblk.fnavn,
> :kundeblk.adresse, :kundeblk.postnr,
> :kundeblk.psted, :kundeblk.kundegruppe, :kundeblk.regdato from kunde
> where kunde.kundenr = :kundeblk.kundenr;
>EXCEPTION
> when no_data_found then
> insert into kunde values(:kundeblk.kundenr,:kundeblk.enavn,
> :kundeblk.fnavn, :kundeblk.adresse,
> :kundeblk.postnr,:kundeblk.psted,:kundeblk.kundegruppe,:kundeblk.regdato);
>END;
>
>This trigger is fired from the customernr field and the intention of this
>trigger is to find out if there is a customer registered with a spesific
>customer number. If there is a customer with e.g customernr 3 then all the
>fields are filled out with the information about that customer. This works
>fine, but when i want the program to be able to accept my values that i put
>into the fields if the customer number is not occupied then i got
>this message
Received on Tue Aug 06 1996 - 00:00:00 CEST

Original text of this message