Document Layout Variables
Document Layout Variables are used to declare variables and specify what value should be assigned to the variable. Variables can then be used in formulas, for printing and for filtering. Using variables for formulas, printing and filtering are done by entering the variable name within square brackets (for example, [CustomerNo]); the system will then replace the variable with its value.
Filters can be applied to Variables to define from which record the value should come.
Filters only need to be set up if the Table No. is different than the Table No. for the Section. If it is the same table, the system assumes that the value should be taken from the record currently being iterated.
Criteria can also be applied to Variables, which specifies the conditions that should be valid for the system to assign the value to the Variable.
The fields on the Document Layout Variables page are described in the following table.
|Variable||Identifies the name of the variable. It is not case sensitive, but it is easier to read if uppercase and lowercase are used.|
|Type||Defines how the system should assign the value to the variable. The options are:
- Value – The value assigned to the variable is based on a value from a field in a table. The table and field are specified in the Table No. and Field No. fields.
- Caption – The value assigned to the variable is based on a caption from a field in a table. The table and field are specified in the Table No. and Field No. fields.
- Formula – The value assigned to the variable is based on a formula entered in the Formula field.
- System – The value is a system value. The value is specified in the System Value field.
- Record ID – The textual Record ID of the current record (if the value in the Table No. field matches the current section’s table number) or a filtered record.
- Text – The variable is a fixed value or the value of a Variable. The value is specified in the Text field.
|Table No.||Indicates the table that is used to get the value for the variable. This field is only used if the Type = Value or Caption.|
|Table Name||Displays the name of the table.|
|Field No.||Indicates the field from which the value should come. This field is only used if the Type = Value or Caption.|
|Field Name||Displays the name of the field.|
|Formula||Identifies a formula that is used for calculation purposes. A formula can contain the following operators: + - * / ^ % and parenthesis (brackets).
Variables can also be used in formulas, in which case the variable name is entered within square brackets, for example, [Amount] * [Quantity].
Formulas make it possible to summarize, calculate averages, count, etc.
|System Value||Indicates the system value to use when the Type = System. The options are:
- User ID – User ID logged into the system.
- Today – Today’s day (based on the operative system).
- Workdate – Workdate according to the Microsoft Dynamics 365 Business Central Client.
- User Language – Language of which the Client is running.
- Time – Current time (based on the operative system).
- Company Name – Name of the company into which the user is logged.
|Text||Specifies a text value or a variable for filtering. This field is only used if Type = Text.
Variables are entered with square brackets (for example, the variable LanguageCode should be entered as [LanguageCode] if the system should use the value of the variable for filtering).
|Last Record||Determines if the system will use the values from the last record (instead of the first) if there is more than one record within the filter.|
|Format String||Identifies the format in which the value should be saved. If the value is a decimal value, the format string can be used to set the number of decimals, etc. If the value is a date value, the format string can be used to set the date format, etc.
Refer to the Microsoft Dynamics 365 Business Central Help for information about specifying different formats.
|No. of Criteria||Displays the number of criteria set up for the variable.|
|No. of Filters||Displays the number of filters set up for the variable.|
Submit feedback for.