Re: Problems raising FORM_TRIGGER_FAILURE

From: ramiro <ramiro_at_accesscom.net>
Date: Tue, 28 Sep 1999 09:12:50 -0500
Message-ID: <37F0CCE1.D3324DFC_at_accesscom.net>


Try the following code after the COMMIT_FORM of your KEY COMMIT trigger.

IF NOT FORM_SUCCESS THEN
   RAISE FORM_TRIGGER_FAILURE ;
END IF ; Let me know if it works.

Jim Limberatos wrote:

> Here is my story:
>
> (block triggers)
> ---------
> WHEN-VALIDATE-RECORD
>
> IF NOT my_boolean_validation_func(:form_data...) THEN
> message('Error, blah blah blah');
> raise FORM_TRIGGER_FAILURE;
> END IF;
> ---------
> KEY-COMMIT
>
> commit_form;
> checks_and_balances;
> ---------
> Everything works fine when the user goes from record to record without
> saving.
>
> The problem occurs when the user tries to save (KEY-COMMIT) an invalid
> record. First, because my KEY-COMMIT trigger calls commit_form , the data
> is saved, but only after triggering WHEN-VALIDATE-RECORD with success
> (part of the normal sequence of events cause by commit_form). Validation
> fails however, so I raise FORM_TRIGGER_FAILURE. There are no exception
> handlers in WHEN-VALIDATE-RECORD, so I would assume that the exception
> would propogate down to after the commit_form command in KEY-COMMIT and
> the "maintenance" code after would not be executed. This is not the case -
> the checks_and_balances code still executes as though there was no
> problem, although clearly the trigger should fail. Even if I put an
> exception block in the KEY-COMMIT trigger, the code still executes,
> causing a mess. I have used the debugger to verify that
> FORM_TRIGGER_FAILURE is in fact being raised and it is.
>
> What am I doing wrong, or how can I make the rest of the key-commit not
> execute if the record(s) they try to save are invalid?
Received on Tue Sep 28 1999 - 16:12:50 CEST

Original text of this message