AX1089
GetGlobalVariable function
Returns the value for a global variable, given the variable name and an optional context.
NOTE: Currently, global variables can only be defined in application code. There is no user interface for clients to create new global variables. However, systems with installed products may see this function used in Axiom files to return globally defined variables for the product.
Axiom supports a variety of variable types that apply only to certain contexts. GetGlobalVariable cannot be used to return values for these specialty variables. For more information on returning values for other variable types, see:
- GetFileGroupVariable to return the value of a file group variable
- GetDocumentInfo to return the value of a document variable
- GetSharedVariable to return the value of a shared variable
Syntax
GetGlobalVariable("VariableName","DefaultValue","Context")
Parameter | Description |
---|---|
VariableName |
The name of the variable for which to return the value. |
DefaultValue |
Optional. The value to be returned, if no value has yet been set for the variable. If defined, the default value will also be returned if no match is found for the variable name and/or context. |
Context |
Optional. The context of the variable. If a context is specified, Axiom must find a match for the variable name / context combination in order to return a defined value. Variable context allows the same variable name to have two different defined values based on a context. |
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.
Remarks
GetGlobalVariable is a non-volatile function.
Examples
=GetGlobalVariable("YearMo")
This example returns the value of the global variable YearMo, as defined by some application feature. If no value is defined for the variable, the function returns blank.
=GetGlobalVariable("YearMo","202101")
This is the same as the first example, except that now the default value 202101 is returned if no value is defined for the variable.
=GetGlobalVariable("YearMo",,"Imports")
This is the same as the first example, except that now the value is returned for the Import context of the variable YearMo. The application could have two different contexts for the variable YearMo, such as one for Imports and one for Reports. Each of the variable/context combinations could have a different value. In this example, the function returns blank if no value is defined for the YearMo/Imports combination (if a default value were defined in the second parameter, the default value would be returned instead).