AX1605

GUID calc method variable

GUID variables can be used to generate a globally unique identifier (GUID) when a calc method is inserted. This is a special variable type that does not display to the user in the Calc Method Variables dialog—it is only used to generate the ID and place it into the inserted calc method. For example, when inserting calc methods for planning new hires, you may want to generate a unique ID for each new hire.

Variable behavior

GUID variables do not display in the Calc Method Variables dialog. If other variables are defined for the calc method, then the variables dialog is shown to the user but the GUID variable is omitted. If the GUID variable is the only variable, then the variables dialog is not shown to the user.

When the calc method is inserted, the designated relative location for the GUID variable is populated with an automatically generated GUID string.

For example, imagine that you have the following calc method configuration. This example uses the CalcMethodVariables data source, but the general configuration and behavior is the same when using legacy variables.

When the user inserts this calc method, no variables dialog displays to the user. Instead the calc method is directly inserted, and a GUID is generated and placed in column E, in the first row of the calc method.

The ID is alphanumeric with dashed sections, such as: a635e1cb-4001-46bd-a427-a704e29b58b8. This format cannot be customized, though you can manipulate the format as needed in the spreadsheet after insertion. If you are saving the generated ID to the database, the destination column must be a string column with a minimum width of 36.

Variable properties

This section explains how to complete a variable row in the CalcMethodVariables data source when defining a GUID variable. Some data source columns do not apply in this case and are not discussed here. If these inapplicable columns are present in the data source, they should be left blank on rows that define GUID variable types. For more information on the GUID data source in general, see Defining calc method variables using a CalcMethodVariables data source.

General variable properties

All calc method variables use a common set of general properties such as the variable name, display name, and whether the variable is enabled or required. Any special considerations for GUID variables are noted.

Column Tag Description

[Name]

The name of the variable. This name identifies the variable row in the data source, and is also used as the variable display name to users if a separate display name is not defined in the [DisplayName] column.

The name should not contain any non-alphanumeric characters such as question marks or periods. If you want the variable name that displays to users to include non-alphanumeric characters, use the display name.

The name cannot be dynamic; it must remain static because it is used to identify the variable. If you are configuring a dependent variable and you need the name to change based on the selection of the parent variable, then you must make the display name dynamic instead of the name.

[DisplayName]

This property does not apply to GUID variables, because these variables do not display to the user.

[VariableType]

Specifies the variable type. Enter GUID to insert a globally unique identifier.

[RelativeLocation]

The location to place the variable value when the calc method is inserted, relative within the calc method.

The location is specified as follows: <ColumnLetter><CalcMethodRow>.

For example:

  • If the value should be placed in column B of the calc method, within the first row of the calc method, enter the following: B1. If the calc method is a single-row calc method, the calc method row is always 1.

  • If the value should be placed in column B of the calc method, but within the third row of the calc method, enter the following: B3.

The entry for the calc method row must be valid within the context of the current calc method. For example, if the current calc method is a three-row calc method, then the only valid entries for the row are 1, 2, and 3. If you attempt to specify B4 for the three-row calc method, the entry is invalid.

[IsEnabled]

Specifies whether the variable is enabled (True/False).

  • If True, then the variable value will be placed in the relative location when the calc method is inserted.
  • If blank or False, then no value will be generated for the variable. This evaluation is determined when the Calc Method Variables dialog is opened. If the variable is flagged as dependent using the [DependsOn] column, then the evaluation will be performed again after a value has been selected for the parent variable.

[SelectedValue]

This property does not apply to GUID variables. The user never selects a value.

[IsRequired]

This property does not apply to GUID variables. The variable never displays to the user. The ID value is always placed in the calc method as long as the variable is enabled.

[DependsOn]

Optional. Specifies that the variable is dependent on a "parent" variable. To make a variable dependent on another variable, enter the name of the parent variable.

Some variable types require a parent variable, such as RelatedColumnValue variables. Other variable types can be made dependent as needed.

Dependent variables can be updated dynamically in response to the selected value for the parent variable. For more information, see Using dependent calc method variables.

[InsertOnly]

This property does not apply to GUID variables. The ID value is always generated on calc method insertion as long as the variable is enabled.

The GUID is intended to be a static value for the inserted row. If Axiom Double-Click is enabled and users can double-click the calc method to change other variable values, this action will not cause the GUID to change.

If users are allowed to change the calc method applied to a row, and the new calc method also has a GUID variable with the same name as the original calc method variable, then the existing GUID value will be retained during the change calc method operation. However, if the GUID variable in the new calc method does not have the same name, then it will be treated as a new insertion and a new GUID will be generated.

Variable-specific properties

GUID variables do not have any variable-specific properties. None of the other data source properties apply to the variable.