AX1635

Apply Shared Variables command

Use the Apply Shared Variables command to set the value of one or more shared variables.

Can be used in

  • Axiom forms

When the Apply Shared Variables command is selected from the Command Library as the shortcut target, it displays as command://ApplySharedVariables or command://ApplySharedVariablesCommandAdapter (legacy syntax).

Shortcut parameters

This command does not have any configurable shortcut parameters. The following parameter is read-only for your information:

Item Description

Processing step

Specifies when the command will be executed during the Axiom form update process.

This option is set to Form - After Updating Values and cannot be changed. For more information, see Timing of command execution and Axiom form update process.

Shared Variables

Use the Shared Variables section to specify the shared variables to be updated and the desired values for those variables.

To define shared variables:

  • Click the plus button to add a new variable/value pair to the Shared Variables section.
  • In the left-hand box, type the name of the variable. For example: Dept.
  • In the right-hand box, type the value to be used for this variable, or enter a cell reference in brackets to read the value from the spreadsheet—for example: [Sheet1!A1]. If the command is being used on a Button tag for a Formatted Grid component, then you can also use a column letter in brackets to read the value from that column on the current row—for example: [C].

The following example shows a shared variable of Dept, where the value is being read from column C on the current row.

When the command is executed, the shared variables listed in this section are set to the specified values. GetSharedVariable functions can be used in the current form and any child forms in order to return the variable values set by the command.

Visibility

In Axiom forms, the command used does not impact whether the button is visible or enabled.

Remarks

  • When using Apply Shared Variables, the current form (and any other forms in the shared form instance, if applicable) should not also use SetSharedVariable functions for the variables listed in the command. If the SetSharedVariable function is used, then the value set by Apply Shared Variables will be overwritten by the function as soon as the function is calculated during the form update process.

  • If the command is used with embedded forms, only the form that contains the command is automatically refreshed to reflect the changed variable value. Other forms in the shared form instance may need to be updated before the new value is reflected in the form. For example, if the command is used in a parent form, the child forms will only be updated if they are forced to refresh by use of the [ForceRefresh] property of a Menu data source, or the Force Refresh property of the Embedded Form.