Calculating the value of a field
Use an expression to calculate the value of a field at run time.
-
Access the field, based on the way that it is defined in your data model.
-
To view fields in a data type:
- In the navigation panel of Dev Studio, click Data types to display the Data Explorer.
- Click the name of a data type.
- Click the Data model tab.
-
To view fields in a case type:
- In the navigation panel of Dev Studio, click Cases to display the Case Type Explorer.
- Click the name of a case type.
- Click the Data model tab.
- Optional: To display fields that are inherited by your application, click Show reusable fields.
-
To view fields in a data type:
- Click the Configure field icon in the row of a field.
- Select the This is a calculated field (read-only) check box. Not all field types support this display mode.
-
Define a calculation by calling a function, referencing properties in an expression, or
creating an advanced expression.
-
To call a function when the field stores a numeric value, such as an integer or
decimal:
- Select an option in the Function list. For example, you can calculate an average or find a maximum value.
- In the Field list, select a single-value field that is defined in a repeating field group.
- Click Submit.
-
To reference a property from a numeric field:
- In the Function list, select Custom.
- In the smart prompt field, enter an expression without quotation makes that uses property names, function, dot notation, and mathematical symbols. Press the Down Arrow Key to see which properties you can reference.
- Click Submit.
-
To reference a property from a non-numeric field:
- In the smart prompt field, enter an expression without quotation makes that uses property names, function, dot notation, and mathematical symbols. Press the Down Arrow Key to see which properties you can reference.
- Click Submit.
-
To create an advanced expression:
- Click Open.
- Configure the Declare Expression form by defining a list of properties and their expected results.
- Click Save.
- Close the Declare Expression form and return to the Calculation dialog box.
- Click Cancel.
-
To call a function when the field stores a numeric value, such as an integer or
decimal:
- Click Submit.