Returns the outcome of the action most
recently performed during the current Run form session.
Use FORM_SUCCESS to test the outcome
of a built–in to determine further processing within any trigger. To get the
correct results, you must perform the test immediately after the action
executes. That is, another action should not occur prior to the test.
Note: FORM_SUCCESS should not be used to
test whether a COMMIT_FORM or POST built–in has succeeded. Because COMMIT_FORM
may cause many other triggers to fire, when you
evaluate FORM_SUCCESS it may not
reflect the status of COMMIT_FORM but of some other, more recently executed
built–in.
A more accurate technique is to check
that the SYSTEM.FORM_STATUS variable is set to ’QUERY’ after the operation is
done.
Example:
/*
** Built–in: FORM_SUCCESS
** Example: Check whether the most–recently executed built–in **
succeeded.
BEGIN
/* ** Force validation to occur*/
Enter;
/* ** If the validation succeeded, then Commit the data. ** */
IF Form_Success THEN
Commit;
IF :System.Form_Status <> ’QUERY’ THEN
Message(’Error prevented Commit’);
RAISE Form_Trigger_Failure;
END IF;
END IF;
END;
No comments:
Post a Comment