SWITCHTO
Syntax
![]()
Command
Mandatory parameter Optional parameter Mandatory keyword Optional keyword |
SWITCHTO (<Application>, <Form>[, <Parameter>[, SHARESESSIONDATA]])
Description
The SWITCHTO command switches to a new Form in another Application in the same AMT environment.
Diagram
Returned value type
None
Parameters
Parameter | Description |
<Application> |
The name of the application to switch to. This application must be in the same repository when developing and
in the same AMT environment in the runtime. |
<Form> |
The name of the form to switch to. |
<Parameter> |
A parameter string to send to the new form. In the new form the parameter string will be available in the
system item SI-PARAM. |
SHARESESSIONDATA |
When defined, the called application will use the session data memory from the calling application. When NOT defined the session data is cleared or used depending on the 'Clean sessiondata on userconnect' setting in the runtime behaviour. |
Instead of the application name, an Alias can also be used.
Remarks
In the Web Client, only the form will be switched in the client. In AMT Screens the select screen menu will list the forms of the application that was switched to. The other functionality, like RtQuery, Report management and Start report, will remain of the originating application. |
This command can only be used inside a Form or a Global routine. When used in a Global routine and that Global routine is then used inside a Report the SWITCHTO command will be ignored in the same way as GOTOTFORM or SHOWPOPUP. |
This command behaves the same way as the GOTOFORM command. I.e. the switch is executed at the end of the Form
logic, so code logic after the SWITCHTO command will be executed before the switch is made. In addition a SWITCHTO command also sets the ERROR system item to true. |
When executing multiple SWITCHTO and or GOTOFORM commands in the logic, the last of these commands will take effect. |
When switching to the Form BYE, the result will be the same as with the command GOTOFORM('BYE'). |
SWITCHTO in a sub-session as created by GOTOFORM(form,,NEW) is not supported in Lion Screens. |
Examples
switchto('CUSTOMER_MANAGEMENT', 'MENU')
switchto('CUSTOMER_MANAGEMENT', 'CUSTOMER', '123')
switchto('CUSTOMER_MANAGEMENT', 'MENU', '', SHARESESSIONDATA)
switchto('CUSTOMER_MANAGEMENT', 'CUSTOMER', '123', SHARESESSIONDATA)
switchto('CUSTOMER_MANAGEMENT', 'CUSTOMER', '123')
switchto('CUSTOMER_MANAGEMENT', 'MENU', '', SHARESESSIONDATA)
switchto('CUSTOMER_MANAGEMENT', 'CUSTOMER', '123', SHARESESSIONDATA)