State Values
State Values are a reusable variables that can be created and then used to automate the behaviour of a Datamodel. The two main techniques for creating a State Value are to dynamically set the value using the result set from a SQL statement or manually setting the value using a text string.
To create a SQL State Value, open the Processes Element menu and select an appropriate event. In the Object pane the right hand click menu will display a New SQL State Value item. Select this item and the new SQL State Value will be added to the event items. Give it a Code and add the SQL statement to the edit pane. The unique name of the State Value will be resolved to be the first column.

SQL State Value
A single SQL statement can generate a single State Value or State Values array depending on the uniqueness of the first column.

SQL State Value Array
Setting a Text State Value is similar to creating a SQL State Value, the key difference is that with Text State Value Code becomes the unique code.

Text State Value
|
Item |
Description |
|---|---|
|
State Values |
|
|
Value |
The syntax for referencing a state value is to prefix the unique code with an equals sign and wrap curly brackets around it. For example, {=DefaultPeriod} is valid syntax to reference the DefaultPeriod value state. |
|
Value array |
The syntax for a value in a state value array is similar to above but the unique array name is suffixed with double colons. For example, {=CompanySettings::LocalCurrency} |
|
Return 1 if code exists but else 0 |
Suffixing the unique code with a question mark will trigger an evaluation. If the code exists it will return 1 and if it does not exist it will return 0. For example, {=PurchasingModule?} will return 0 if the state value does not exist. This can simplify the suppression of query objects by setting there Hide Condition to {=PurchasingModule?}=0 |
|
Return empty string if code does not exist otherwise its value |
Suffixing the unique code with a exclamation mark will return an empty string if the code does not exist. For example, {=Display_ADDRESS3!} will return an empty string if this code does not exist. Useful when a state value is reference in a Description field but this will raise an error if the state value does not exist. |
