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 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.
You can use the following options to set expressions in Expression Editor:
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:
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.
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.
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.
To use operators, click Operators in the left vertical box, and then double-click required operator in the middle vertical box.
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.
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].
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.
To use fields, click Constants in the left vertical box, and then double-click required constant in the middle vertical box.
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.