You can set expressions in the Expression Editor for custom properties, custom workflow actions, and custom ETL rules.

To set expression

1. Log on to your database in Configurator.

2. Click required property, workflow action, or ETL rule, and then click ellipsis in the Initial Expression or the Expression box.

For example, to set expression of a property, click the right-pointing arrow next to Entities, click the right-pointing arrow next to required entity, click the right-pointing arrow next to Properties, click required property and then click ellipsis in theInitial Expression or the Expression box.

Note Default properties of entities are locked and cannot be edited, so expressions can be added to custom properties only.

Expression vs. Initial Expression

Expression calculates values for both new and existing records, while Initial Expression calculates values for the newly created records only.

For example, if the majority of your customers are from the United States, you can set United States as the initial expression value for custom property Country, so when you add a new customer account to your database, the Country box will be automatically filled in with United States value.

Expression Editor

You can use the following options to set expressions in Expression Editor:

Functions

To use functions, click Functions in the left vertical box, and then double-click required function in the middle vertical box.

Note Functions are grouped into four types:Date-time, Logic, Math,and String. To display functions of particular type, click the down-pointing arrow in the (All) box above the middle vertical box, and then click required type.

You can learn how to use functions by the following examples:

Function "Current User()"

You can use the Current User() function in the Initial Expression box of the custom property Owner of the custom entity Quote...

... so the user who creates a new quote will automatically become its owner.

Function "Now()"

You can use the Now() function in the Expression box of the workflow action Close Date of the custom property CloseDate of the custom entity Order...

... so when you close the quote, its field Date Closed will be automatically filled with current system date.

Function "This()"

You can use the This() function which returns root context source value in the Expression box of the Invoice ITL Rule field of the Invoice Analytics OLAP Cube...

... so in the Layout Settings pane of the Invoice Analytics view, the Invoice field will be expandable and will include all properties related to the Invoice entity.

Operators

To use operators, click Operators in the left vertical box, and then double-click required operator in the middle vertical box.

Example

You can use operator + to calculate Total Amount of each quote by summing up Tax Amount and Subtotal Amount...

... so the program will automatically add Subtotal to Tax Amount to show the Total.

Fields

To use fields, click Fields in the left vertical box, and then double-click required field in the middle vertical box.

Note Default fields always begin with an upper case letter (e.g. "[Code]", "[Folder]", etc.), while custom properties begin with "cs" characters (ex.: "[csDate]", "[csName]", etc.).

Tip You can use properties of various entities in one expression, by using the field pattern [EntityName.EntityProperty].

Example

You can use the [csProduct.csListPrice] field in the Expression box of the csPrice property in the Items table of the Order entity...

... so when you open the Order dialog box you will see the Items list with a list price next to each product.

Constants

To use fields, click Constants in the left vertical box, and then double-click required constant in the middle vertical box.

Example

You can use the True constant in the Initial Expression box of thecsActive property of the Contact entity...

... so when you create a new contact, the Active check box will be selected by default.