AMT Help Files

GOTOFORM

Syntax

Command
Mandatory parameter
Optional parameter
Mandatory keyword
Optional keyword

GOTOFORM ([<Form> [, <Help>[, NEW]] | BYE])

Description

When the current form finishes, execution will continue with DISPLAY_MAIN of the mentioned form.

Diagram

Returned value type

None

Parameters

Parameter Description
<Form> Expression giving the name of a form. This option is not available inside popup forms.
<Help> If the help screen parameter is used, the set help page will be opened in a new tab.
Allowed values are:
  • An expression giving the name of an AMT created help screen.
  • An expression giving the filename of a plain text file or HTML file located in the Help folder of the application.
    Filepaths relative to the Help folder may be used.
    The Help folder location is set in the Basepaths screen of the ControlCenter.
  • An expression giving the absolute filepath and filename of a plain text file or HTML file.
See the examples below.
NEW Opens the (help) screen in a new tabsheet and counting as new subsession, provided that AMT Screens is used and the Tabforms setting for the application has been set to either "Multiple tabforms with Shared Session Data" or "Multiple tabforms with Private Session Data". When choosing for Private Session Data, there will be created a copy of the Retained Session Data for the calling screen (which will not be the case for retained variables). The NEW parameter is not supported for the AMT Webclient.
BYE

Terminates the application.

Note:

formname := ’BYE’
gotoform(formname)

is the same as gotoform(BYE), that is, BYE can either be a keyword, a literal or a string value.


Remarks

When the form is omitted, the current form is displayed (DISPLAY_MAIN is skipped).
Using the GOTOFORM command, it is possible to edit a dummy form that does not use the layout, but only does some checks and then starts another form.
In addition a GOTOFORM command also sets the ERROR system item to true.

If the option Security checking GOTOFORM is enabled in the Control Center, the runtime Business Logic will check if a user has rights to access the requested form when a GOTOFORM is executed.

 

Form calling priority

The commands ‘gotoform’, ‘refresh’, ‘closeform’ and ‘showpopup’, all execute the remaining display/process main logic, so it is possible that multiple instances of these commands are encountered before the transaction has ended.

The table below explains which command takes priority and is ultimately executed.

  1     Indicates that this command overrules the previously encountered command, which is now not executed.

  2     Indicates that the previous command takes precedence over this command, so it is the previous command only that is executed.

  3     Indicates that both commands will be 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

The optional help screen request is not relevant for the priority of the commands. If the command is executed, any help screen also requested will be displayed.

Examples

(A)
gotoform (bye)

(B)
gotoform ('form_a''help_form_a'new)

(C)
gotoform ('Welcome')

(D)
gotoform ('form_b''TXT\help_form_b.txt'new)

If a form would contain all codelines of the examples A, B, C and D, and this code would be executed in the same order, then the instruction of example A would be overruled by the instruction of example C. As a result, the code of the current subsession would then change into the screen 'Welcome' and the new subsessions 'Form_A' and 'Form_B' would also be opened along with their help screens.

 

Return to

Commands