AX1164

Grid calc method variable

Grid calc method variables prompt users to select a value from a designated table column. For example, you may want the user to select an account from the Acct.Acct column. The list of values is displayed in a dialog, using a searchable grid.

There are two ways that you can specify the column to use for the Grid variable:

  • Specify the table column directly, from any table.
  • Specify a Picklist table name. This automatically uses the Code column as the value column, but also automatically displays the Value and Description columns.

Both ComboBox variables and Grid variables can be used to select a value from a table column. The primary difference between the two variable types is the user interface for selecting the value—using either a drop-down list or a grid dialog. Additionally, only Grid variables allow selection of multiple values.

When using Grid variables, you can also use RelatedColumnValue variables. These are special variables that do not display to users. Instead, they are used to return values from related columns. For example, if you are prompting users to select an account, then you can use a RelatedColumnValue variable to return the description of that account from the Acct.Description column. For more information, see RelatedColumnValue calc method variable.

NOTE: Grid variables can be used when inserting calc methods in Axiom forms, but only when multi-select is enabled. If multi-select is not enabled, then the Grid variable will behave like a ComboBox variable, so it is recommended to use a ComboBox variable instead.

Variable behavior

In the Desktop Client, the variable displays as a text box with a Choose Value button next to it. The user can do one of the following to specify a value:

  • Type a value directly into the text box. The entry must match a value in the designated table column for the variable. If the user enters an invalid value, then a validation message displays at the bottom of the dialog. The OK button is disabled until the user enters a valid value.

  • Click the button to open the Choose Value dialog, to select a value from the designated table column for the variable. This dialog has a search box so that the user can type to find values in lengthy lists. If multi-select is enabled for the variable, then the Choose Value dialog has check boxes to enable multiple selections. Once the user has selected a value, the value displays in the text box.

Desktop Client: Example grid variables

The Choose Value dialog uses either the "simple view" or the "full grid view" depending on the data to be displayed in the dialog. If only one column is being shown, or a key column plus description only, then the simple view is used. However, if the target column is a key column and any additional non-description columns are included, then the full grid view is used.

Example Choose Value dialog using "simple view"

Example Choose Value dialog using "full grid view" and with multi-select enabled

The list of values in the Choose Value dialog is sorted based on the designated table column for the variable. In some cases the values may not be displayed as expected:

  • If the column is from a document reference table, the values will most likely not be displayed in the order they are stored in the source file. When the values are saved to the database from the source file, they are sorted based on the key column of the table (column A of the sheet).

  • If the column is a string column that contains numeric values (values that are all numbers and values that start with numbers), Axiom will attempt to sort these values in numeric order. Values that start with letters will then be sorted in alphabetical order.

When used with Axiom forms and multi-select is enabled for the variable, the variable initially looks like a ComboBox variable.

However, when the user clicks the down arrow to select a value, a dialog opens instead, allowing the user to select multiple values using check boxes. The behavior of this dialog is the same as when using multi-select with a form combo box (Select tag). For more information, see Multi-select dialog behavior.

The "full grid" view is not used with Axiom forms, even if multiple additional columns are specified. The additional column values are concatenated with hyphens. This means that the values cannot be sorted by column, but users can still use the search box to find particular values.

If multi-select is not enabled for the variable, then the variable behaves the same way as a ComboBox variable when used in Axiom forms. Therefore, it is strongly recommended to use a ComboBox variable with Axiom forms instead, if you do not need multi-select.

Variable properties

This section explains how to complete a variable row in the CalcMethodVariables data source when defining a Grid variable. Some data source columns do not apply in this case and are not discussed here. If any inapplicable columns are present in the data source, they should be left blank on rows that define Grid variable types. For more information on the CalcMethodVariables 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 Grid 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]

Optional. The display name of the variable. If defined, the display name will be used instead of the name when the variable displays to users.

[VariableType]

Specifies the variable type. Enter Grid to allow the user to select a value from a designated table column, using a searchable grid dialog.

[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 will be included in the Calc Method Variables dialog.
  • If blank or False, then the variable will not be included in the Calc Method Variables dialog. This evaluation is determined when the Calc Method Variables dialog is opened. If the variable is flagged as dependent using the [DependsOn] column, and the current context is a spreadsheet file in the Desktop Client, then the evaluation will be performed again after a value has been selected for the parent variable.

[SelectedValue]

For calc method variables, the [SelectedValue] column is only used for dependent variables. When the calc method is inserted and the user selects a value for the parent variable, the selected value is written back to this field temporarily, in the background. This means you can write formulas that change something about the dependent variable based on the selected value of the parent variable. For more information, see Using dependent calc method variables.

This field cannot be used to set a default value for the variable. Calc method variables do not support the ability to define a default value.

[IsRequired]

Optional. Specifies whether the user must enter a value for this variable (True/False).

  • If True, then the user must specify a value for this variable in order to insert the calc method.
  • If blank or False, then the user can leave the variable blank. The calc method should be configured so that it works as expected if the variable is left blank.

The display of required and optional variables depends on the environment. In the Desktop Client, the text (optional) follows the name of optional variables. In the Web Client, required variables that do not yet have a selected value are indicated with a red bar along the side of the variable field.

[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]

Specifies when the variable should be displayed:

  • If True, then the variable is only displayed when a user inserts the calc method. It is excluded from the dialog during all other operations, including change (overwrite) and double-click. If all variables for the calc method are set to Insert Only, then the dialog only displays when inserting.

  • If blank or False, then the variable is displayed in all cases.

Variable-specific properties (table column)

The following additional properties apply to Grid variable types, when specifying a table column directly.

Column Tag Description

[ColumnName]

The column to provide the list of values for the variable. Enter a fully-qualified Table.Column name such as Acct.Acct. Multi-level lookups can be used.

You can specify any column from any client table in your system. System tables such as Axiom.Aliases are not supported for use with variables and cannot be used.

When using columns with lookups (including multi-level lookups), the final lookup table is considered the primary table. For example, if you specify GL2020.Dept, this is the same as specifying GL2020.Dept.Dept, so the Dept table is the primary table. Any columns listed in filters and as additional columns must be resolvable from the primary table, or must contain a fully qualified path from the starting table (GL2020 in this example).

When using columns with lookups, the starting table impacts the list of items to be returned from the value column. For example, GL2020.Dept returns only the departments used in the GL2020 table, whereas Dept.Dept returns the full list of departments defined in the Dept table.

If the value column is a key column or a validated column, then the corresponding descriptions automatically display with the column values in the grid, unless additional columns are defined.

[AdditionalColumns]

Optional. One or more additional columns to display in the selection dialog along with the value column. Separate multiple column names with commas or semicolons.

Any columns listed should use fully qualified Table.Column syntax. If the value column uses a lookup, then any additional columns must be resolvable from the primary table, or must use a fully qualified path from the starting table. Column-only syntax is only allowed for columns directly on the primary table.

NOTES:  

  • If [AdditionalColumns] is left blank, then any description columns associated with the value column are automatically included in the grid. However, if you do specify any additional columns then you must also include the desired description columns.

  • When used in the Web Client, additional column values are concatenated to the key value using hyphens. They do not display as separate columns. For example, if the key is Dept and additional columns are Description and Country, the value will display like 24000 - Finance - United States. If you do not like this display, then in the Web Client only, you can use the [DisplayFormat] parameter to impact the display of the list in the multi-select dialog.

[ColumnFilter]

Optional. A filter criteria statement to limit the list of values displayed to the user. You can type in the filter statement manually, or right-click the cell and use Axiom Wizards > Filter Wizard.

If the value column uses a lookup, then the column in the filter criteria statement must be resolvable from the primary table, or must use a fully qualified path from the starting table.

[PlaceholderText]

Optional. Defines placeholder text to display within the variable box until a value is selected. This text also displays at the top of the Choose Value dialog, and as a tooltip for the Choose Value button. If blank, then the default text "Choose a value for ColumnName" is used.

[AllowMultiSelect]

Optional. Specifies whether multiple values can be selected from the designated column (True/False).

  • If True, then the list of values will display with check boxes and the user can select more than one item. The values will be placed in the calc method location as a comma-separated list. If the column is a string column, the values will automatically be wrapped in single quotation marks.

  • If blank or False, then only one value can be selected from the column.

[DisplayFormat]

Optional. Defines a display format for the items in the list. This only applies to Grid variables when used in the Web Client, to control the display of items in the multi-select dialog. The display format is ignored in the Desktop Client.

By default, items in the list are displayed as:

KeyColumn - DescriptionColumn

If you want to specify a different format and/or use additional columns, then you can indicate the display format here. Use fully qualified Table.Column syntax and place column references in curly brackets. For example, you could indicate something like:

{Acct.Acct} - {Acct.Description} ({Acct.Category})

This would display account items in the following format:

8000 - Facilities (Overhead)

Any columns listed should use fully qualified Table.Column syntax. If the value column uses a lookup, then any additional columns must be resolvable from the primary table, or must use a fully qualified path from the starting table.

If a display format is defined, the items in the list are sorted based on the display format instead of the value column.

[TooltipColumn]

Optional. Specifies a column that defines tooltip text for each value shown in the list. When a user hovers over a value in the list, the corresponding text from this column is shown in a tooltip.

If the value column uses a lookup, then the tooltip column must be resolvable from the primary table, or must use a fully qualified path from the starting table.

[AutoQuoteString]

Optional. Specifies whether the string value is placed in single quotation marks when it is written to the calc method location (True/False). If omitted or blank, the default setting is False, which means the string value is not quoted.

This option is intended to make it easier to create filters based on the selected value, when the selected value is a string and therefore must be wrapped in single quotation marks. For example: Dept.VP='Smith'. This option is not commonly used in calc method variables.

NOTE: This option only applies if the value column is a string column, and only if multi-select is not enabled for the variable. If multi-select is enabled, then string values are always quoted.

The following properties do not apply to Grid variables when using a table column: DataSourceName, ListChoices, Hierarchies, MinDate, MaxDate, PrimaryTable, LimitColumn, MinValue, MaxValue, StepFrequency.

Variable-specific properties (Picklist table)

The following additional properties apply to Grid variable types, when specifying a Picklist table.

Column Tag Description

[DataSourceName]

Specifies the picklist table to define the list of values. Use the following syntax:

Picklist: TableName

For example, Picklist: Category uses the picklist table named Category.

When a picklist table is the data source, this is effectively the same as designating the Code column of the picklist table as the source column. The additional picklist columns of Value and Description are also displayed in the grid.

[ColumnFilter]

Optional. A filter criteria statement to limit the list of codes displayed to the user. You can type in the filter statement manually, or right-click the cell and use Axiom Wizards > Filter Wizard.

[PlaceholderText]

Optional. Defines placeholder text to display within the variable box until a code is selected. This text also displays at the top of the Choose Value dialog, and as a tooltip for the Choose Value button. If blank, then the default text "Choose a value for ColumnName" is used.

[AllowMultiSelect]

Optional. Specifies whether multiple codes can be selected from the picklist (True/False).

  • If True, then the list of codes will display with check boxes and the user can select more than one item. The codes will be placed in the calc method location as a comma-separated list.

  • If blank or False, then only one code can be selected from the column.

[DisplayFormat]

Optional. Defines a display format for the items in the list. This only applies to Grid variables when used in the Web Client, to control the display of items in the multi-select dialog. The display format is ignored in the Desktop Client.

By default, items in the list are displayed as:

KeyColumn - DescriptionColumn

If you want to specify a different format and/or use additional columns, then you can indicate the display format here. Use fully qualified Table.Column syntax and place column references in curly brackets. For example, you could indicate something like:

{Acct.Acct} - {Acct.Description} ({Acct.Category})

This would display account items in the following format:

8000 - Facilities (Overhead)

If a display format is defined, the items in the list are sorted based on the display format instead of the value column.

When defining a display format for use in the Web Client, you can also optionally use the TooltipColumn property to display tooltip text for each item. This is not applicable in the Desktop Client, because all picklist columns display in the grid in the Desktop Client.

[TooltipColumn]

Optional. Specifies a column in the picklist table that defines tooltip text for each value shown in the list. When a user hovers over a value in the list, the corresponding text from this column is shown in a tooltip.

Although you can specify a tooltip column when using a picklist table data source in the Desktop Client, there is typically no reason to do so, because the grid already shows all columns in the picklist table.

The following properties do not apply to Grid variables when using a picklist table: ListChoices, ColumnName, AdditionalColumns, Hierarchies, MinDate, MaxDate, AutoQuoteString, PrimaryTable, LimitColumn, MinValue, MaxValue, StepFrequency.

Example data source

The following screenshot shows examples of Grid variables. The first variable uses a filter and does not allow multi-selection. The second variable allows multi-selection. The third variable uses a picklist table.