Description
Causes Form Builder to update data in the database to match data in the form. Form Builder first validates the form, then, for each block in the form, deletes, inserts, and updates to the database, and performs a database commit. As a result of the database commit, the database releases all row and table locks.
If the end user has posted data to the database during the current Runform session, a call to the COMMIT_FORM built-in commits this data to the database.
Following a commit operation, Form Builder treats all records in all base-table blocks as if they are queried records from the database. Form Builder does not recognize changes that occur in triggers that fire during commit processing.
Syntax
PROCEDURE COMMIT_FORM;
Built-in Type restricted procedure
Enter Query Mode no
** Built-in: COMMIT_FORM
** Example: If there are records in the form to be
** committed, then do so. Raise an error if the
** commit was not successful.
*/
BEGIN
/*
** Force validation to happen first
*/
Enter;
IF NOT Form_Success THEN
RAISE Form_Trigger_Failure;
END IF;
/*
** Commit if anything is changed
*/
IF :System.Form_Status = 'CHANGED' THEN
Commit_Form;
/*
** A successful commit operation sets Form_Status back
** to 'QUERY'.
*/
IF :System.Form_Status <> 'QUERY' THEN
Message('An error prevented your changes from being
committed.');
Bell;
RAISE Form_Trigger_Failure;
END IF;
END IF;
END;
Example 2
/*
** Built-in: COMMIT_FORM
** Example: Perform Form Builder database commit during commit
** processing. Decide whether to use this Built-in
** or a user exit based on a global flag setup at
** startup by the form, perhaps based on a
**
** Trigger: On-Commit
*/
BEGIN
/*
** Check the global flag we set during form startup
*/
IF :Global.Using_Transactional_Triggers = 'TRUE' THEN
User_Exit('my_commit');
/*
** Otherwise, do the right thing.
*/
ELSE
Commit_Form;
END IF;
END;
Wednesday, July 8, 2009
Subscribe to:
Post Comments (Atom)
Stay committed to your decisions, but stay flexible in your approach. See the link below for more info.
ReplyDelete#committed
www.ufgop.org
good info
ReplyDeletethanks you sir
thanks for sharing exactly what the Forms Builder online help shows, must have taken alot out of you to copy and past
ReplyDelete1. Assume that 'HIER' is the master block and 'HIER_ITEMS' is the detail block
ReplyDeleteand exiting out of the 'HIER_ITEMS' block where 'HIER_ITEMS' is in it's own WINDOW
IF :SYSTEM.FORM_STATUS = 'CHANGED' THEN
GO_BLOCK('HIER_ITEMS');
CLEAR_BLOCK(ASK_COMMIT);
END IF;
GO_BLOCK('HIER');
2. Same WINDOW
IF :SYSTEM.FORM_STATUS = 'CHANGED' THEN
GO_BLOCK('HIER_ITEMS');
CLEAR_BLOCK(ASK_COMMIT);
EXECUTE_QUERY;
END IF;
GO_BLOCK('HIER');