Download PDF
Download page Formula Builder.
Formula Builder
When creating a formula field for your object, create a field in Schema Manager and enable the Is Calculated toggle. This enables Formula Builder, a tool that allows you to create expressions to calculate the value of a field (for example, calculating the net price of a line item using the formula SalesPrice * Quantity).
Click Construct a formula here to open the Formula Builder, which allows you to create simple to complex expressions used to calculate field values for your object. All of the fields in the context object are available to use in the expression.
To create a calculated field expression
- Go to the Field tab and search for your desired field from the list. Click the arrow next to the field name to view and select its related child fields. The formula expression, determined by the selected object-field and/or subfield, appears on the right panel of the application.
Click Insert to add it to the expression.
The Is Pre-Computed toggle is for formula expressions that involve cross-object fields. It allows you to control how cross-object field values are handled during the evaluation of a formula expression. Formula expressions are typically evaluated at runtime, meaning their values are calculated when needed. However, when dealing with cross-object fields in a formula expression, the Is Pre-Computed toggle comes into play.
If the toggle is enabled, the cross-object fields used in the formula expression are computed before runtime.
If the toggle is disabled, the expression fetches the values of cross-object fields at runtime, just before evaluating the formula.
Once a formula expression is defined, you cannot change the Is Pre-Computed flag. If it is initially set to FALSE, you cannot change it to TRUE later. For more information on cross-object formula expression, see Creating Cross-Object Formula Expression.
- Go to the Functions tab, select a function from the list, and click Insert to add it to the expression.
- Click any operator available below the expression window to add it to the expression.
- Continue building your expression.
- Click Clear to remove the entire expression, or manually remove it by pressing the Backspace key.
Click Validate to check your formula. The application verifies the formula and displays a confirmation message if it is valid. If the formula is invalid, an error message is displayed.
- When you are finished, click OK. The expression you created is displayed in the Formula field.
- Click Save to finish or Save & Create New to create more custom fields.
Types of expression and supported functions
This table shows the types of formula expression you can define.
Types of Expression | Example |
---|---|
Lookup access |
|
Field access |
|
Field value comparison |
|
Datatype equality (field comparison) |
|
Mathematical operation |
|
Logical operations |
|
Conditional/Ternary operations |
|
Built-in object operation |
|
Relational operation |
|
Functions usages |
|
Guidelines for Functions
When working with functions, use built-in C# syntax whenever applicable. For instance, consider the following expression:
FN.NOT(FN.ISBLANK(Agreement.Description))
This can be simplified using inbuilt C# syntax as:
!string.IsNullOrEmpty(Agreement.Description)