AX1591

GetSharedVariable function

Returns the value of a named shared variable.

This function is only for use in embedded formsBy using an Embedded Form component, a parent form can display one or more child forms within the same form instance. These forms can share values and leverage other special update and save behaviors., where there is a parent form with one or more child forms displayed using the Embedded Form component. Shared variables provide a way to pass information between the parent form and the child forms.

Syntax

GetSharedVariable("VariableName", "DefaultValue")

Parameter Description

VariableName

The name of a particular shared variable for which you want to return the value.

DefaultValue

Optional. The value to be used for the shared variable, if no value has yet been set for the variable.

When the GetSharedVariable function is calculated, Axiom Financial Institutions Suite checks the shared variable list that is stored in memory for the shared form instance.

  • If no value currently exists for the specified variable, the variable value is set to the default value defined in the function. This becomes the actual defined value for the variable, to be shared with the other forms in the shared form instance.

  • If a value already exists for the specified variable, then the default value is ignored and the function returns the defined value for the variable.

All non-numeric entries must be placed in double quotation marks, unless you are using cell references to reference the text held in another cell.

Shared variable values

(missing or bad snippet)

Variable values can be set within the parent form or within any child form. Once the variable value is set, it is then available to all forms within the shared form instance, though forms must be updated in order to reflect a changed variable value. For more information see Sharing variables between parent and child forms.

Remarks

  • When an Axiom form with an Embedded Form component is first opened, the functions in the parent form are evaluated before the embedded child form. Therefore, the DefaultValue parameter in the child form only applies if the parent form does not already set a value for the shared variable.

  • It is typically not feasible to use an Axiom function or a data lookup to determine the value to be used in the DefaultValue parameter, because the GetSharedVariable function will calculate and set the variable value before the other queries resolve.

  • GetSharedVariable is a volatile function.

NOTE: (missing or bad snippet)

Examples

=GetSharedVariable("PlanCode")

This example returns the value of the shared variable PlanCode—for example: 42000. If no value has yet been set for this shared variable, the function will return blank.

=GetSharedVariable("PlanCode","1000")

This example is the same as the first example, except that if no value has yet been set for the shared variable PlanCode, then the value will be set to 1000 and the function will return 1000. If the variable value is subsequently changed by using a SetSharedVariable function or an interactive component, then the default value of 1000 will be ignored and the function will return the currently defined value for the function.