FORMS 4.5: WHEN-VALIDATE-ITEM TRIGGER

From: Erlend Stokkedal <estokked_at_sn.no>
Date: 1996/08/06
Message-ID: <estokked.31.000ADAAF_at_sn.no>#1/1


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:

DECLARE
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:

FRM 40508: ORACLE error: Unable to INSERT record.

Can anyone please help me?

Best regards from Erlend:-) Received on Tue Aug 06 1996 - 00:00:00 CEST

Original text of this message