Problems raising FORM_TRIGGER_FAILURE

From: Jim Limberatos <jlim_at_surf.pangea.ca>
Date: 27 Sep 1999 16:49:40 -0500
Message-ID: <7soopk$3t7_at_surf.pangea.ca>



Here is my story:

(block triggers)



WHEN-VALIDATE-RECORD [Quoted] [Quoted] [Quoted]   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 Mon Sep 27 1999 - 23:49:40 CEST

Original text of this message