| Syntax Color Legend |
|---|
| Command |
| Mandatory parameter |
| Optional parameter |
| Mandatory keyword |
| Optional keyword |
CLOSEFORM ()
Closes the current sub-session (multi-tab or pop-up form), provided that it is not the main session.
N/A
None
None
A CLOSEFORM is implicitly followed by a REFRESH. This means that, after the current sub-session is closed, the previous form appears again. Only when a pop-up form is closed is the PROCESS_MAIN routine of the reappearing form executed again. If a multi-tab sub-session is closed, this routine is not executed again. In addition, the CLOSEFORM command also sets the ERROR system item to true.
| The CLOSEFORM command cannot be used in a form that has COM/DCOM enabled or web service enabled. The command has no meaning in a COM/DCOM or web service connection to the form because no actual graphical form exists. Therefore, the command is prohibited when either option is enabled. |
The commands gotoform, refresh, closeform, and showpopup all execute the remaining display or PROCESS_MAIN logic. As a result, multiple instances of these commands can be encountered before the transaction ends.
The table below explains which command takes priority and is ultimately executed.
1 indicates that the command overrides the previously encountered command, which is not executed.
2 indicates that the previous command takes precedence over this command, so only the previous command is executed.
3 indicates that both commands are executed.
| This command | Previous command | |||||
|---|---|---|---|---|---|---|
| gotoform (form) | gotoform (BYE) | refresh () | closeform () | showpopup (popup form) | gotoform (form, , NEW) | |
| gotoform (form) | 1 | 1 | 1 | 1 | 1 | 3 |
| gotoform (BYE) | 1 | - | 1 | 1 | 1 | 1 |
| refresh () | 1 | 1 | - | 1 | 1 | 3 |
| closeform () | 1 | 1 | 1 | - | 1 | 3 |
| showpopup (popup form) | 1 | 1 | 1 | 1 | 1 | 1 |
| gotoform (form, , NEW) | 3 | 2 | 3 | 3 | 1 | 3 |
closeform()