Invoke Script

RAMP-NL

Invoke Script


Every Destination Screen has an invoke script which controls how it is displayed. Here is an example of a script that invokes a SHOWORDER screen when an order is selected in the instance list:

First the script navigates to the 5250 junction screen GETORDER which is used to select which order is to be shown:

 

NAVIGATE_TO_JUNCTION("GETORDER");

 

It then makes sure that we get to the GETORDER screen. If this check fails an error message is shown:

 

if ( !(CHECK_CURRENT_FORM("GETORDER", "Unable to navigate to form GETORDER")) ) return;

 

Next the script retrieves the current order number from the instance list to the GETORDER screen. Typically you need to edit this part of the script (see Replacing Hardcoded Employee Number with Current Instance List Entry):

 

SETVALUE("ORDERNUMBER", objListManager.AKey1[0] );

 

And then presses the Enter key to process the GETORDER screen:

 

SENDKEY(KeyEnter);

 

Finally the script makes sure that screen SHOWORDER has arrived back from the System i and is ready to be displayed. If this check fails, an error message is shown:

 

if ( !(CHECK_CURRENT_FORM("SHOWORDER", "Unable to display order number " + objListManager.AKey1[0] )) ) return;

 

 

Also See:

NAVIGATE_TO_JUNCTION Function

CHECK_CURRENT_FORM Function

SETVALUE Function

SENDKEY Function