Wednesday, July 8, 2009

EXIT_FORM built-in

Description

Provides a means to exit a form, confirming commits and specifying rollback action.

n In most contexts, EXIT_FORM navigates “outside” the form. If there are changes in the current form that have not been posted or committed, Form Builder prompts the operator to commit before continuing EXIT_FORM processing.

n If the operator is in Enter Query mode, EXIT_FORM navigates out of Enter Query mode, not out of the form.

n During a CALL_INPUT, EXIT_FORM terminates the CALL_INPUT function.

Syntax

PROCEDURE EXIT_FORM;
PROCEDURE EXIT_FORM
(commit_mode NUMBER);
PROCEDURE EXIT_FORM
(commit_mode NUMBER,
rollback_mode NUMBER);

Built-in Type restricted procedure
Enter Query Mode yes

Parameters

commit_mode ASK_COMMIT Form Builder prompts the operator to commit the changes during EXIT_FORM processing.
However, if RECORD_STATUS is INSERT but the record is not valid, Form Builder instead asks the operator if the form should be closed. If the operator says yes, the changes are rolled back before the form is closed.

DO_COMMIT Form Builder validates the changes, performs a commit, and exits the current form without prompting the operator.
NO_COMMIT Form Builder validates the changes and exits the current form without performing a commit or prompting the operator.
NO_VALIDATE Form Builder exits the current form without validating the changes, committing the changes, or prompting the operator.

rollback_mode TO_SAVEPOINT Form Builder rolls back all uncommitted changes (including posted changes) to the current form's savepoint.

FULL_ROLLBACK Form Builder rolls back all uncommitted changes (including posted changes) that were made during the current Runform session. You cannot specify a FULL_ROLLBACK from a form that is running in post-only mode. (Post-only mode can occur when your form issues a call to another form while unposted records exist in the calling form. To prevent losing the locks issued by the calling form, Form Builder prevents any commit processing in the called form.)
NO_ROLLBACK Form Builder exits the current form without rolling back to a savepoint. You can leave the top level form without performing a rollback, which means that you retain the locks across a NEW_FORM operation. These locks can also occur when running Form Builder from an external 3GL program. The locks remain in effect when Form Builder returns control to the program.

Usage Notes

Because the default parameters of EXIT_FORM are ASK_COMMIT for commit_mode and TO_SAVEPOINT for rollback_mode, invoking EXIT_FORM without specifying any parameters in some contexts may produce undesired results. For example, if the form is in POST only mode and EXIT_FORM is invoked without parameters, the user will be prompted to commit the changes. However, regardless of the user’s input at that prompt, the default rollback_mode of TO_SAVEPOINT rolls back the changes to the form despite a message confirming that changes have been made. To avoid conflicts explicitly specify parameters.

1 comment:

  1. whan i call new form in button and close current form But The Current For Dont Close ..

    ReplyDelete