Assigning Global Variables in Events
To make a data element available to use as input or output at any point in your application, assign it to a global variable. When you assign variables as part of an event, that variable won't have the value you specified until the event has been run. You can also assign global variables through the Screen Binding editor. Variables assigned in this manner will have the specified value as soon as the bound screen is processed (an action occurs on that form causing it to be submitted to the run-time service).
|To assign a data element to a global variable
- Create an event, and add an Assignment action to it.
- From the Assignment Properties pane, click the Assign Global Variables button.
The Assign Global Variables dialog box appears, showing the eligible data on the left, and the available Global Variables on the right.
- Map the data element to a new or existing global variable.
|Create a new global variable
|Create a new global variable, and map a constant to it
- Under Global Variables, right-click the Global Variables node and choose New.
- Provide a name for the new global variable.
- Right-click the global variable you just created, and then choose Map Constant.
- Provide the value for the new constant (which will become the value of the global variable when the action is processed).
|Change the value of an existing global variable with the current action
- Select the data element you want to map to the variable, then select the global variable to which you want to assign the data value.
- Click the Add Mapping button.
The eligible data will consist of two client run-time environment variables, IPAddress and UserName, all of the controls on the current form, and any previously defined global variables; the results of other mappings may also be available.
- From the Event editor, click OK.