Approval process expressions provide a method for qualifying whether an object record should be routed through specific approval steps.
To connect individual expressions together using OR and AND, you must use the advanced options. For details, see Creating Advanced Options.
There are three types of expression: standard, advanced and bound.
|This uses a field from an approval process's object record and an operator to compare to a single value to determine if a process can enter a certain approval step. The value can be a constant, entered manually or selected from a picklist, depending on the field type.
|This builds on a simple expression by enabling the value to come from a custom value expression. The custom value is derived from building another equation using a custom field in a custom table.
|The same as advanced, except that the filter expression can use a field from the business object record in the approval process.
Your criteria can contain a simple field, operator, and value, or the value can be composed of a custom expression evaluated at runtime that includes resolving a value from a custom table, a custom field in that table, and an optional filter expression to narrow the rows down in that table. Custom filter expressions can also use bind variables that substitute the value of a field from the context object at runtime.
The field comes from the business object associated with the approval process. Along with the operator, this forms the typical first two thirds of an equation.
Selecting Custom enables the Custom Value Expression section for creating advanced and bound expressions. It also sets Value to a read-only "NA".
Object is a custom Salesforce object containing the available fields. The value selected for Field is compared to the field in part A. These two fields and the operator form the expression in its most basic form. The expression is evaluated for each row in the custom object.
You can use Filter Expression to limit the number of rows in the custom object that are used as part of the overall expression. Any field in the custom object can be used to create a filter expression independent of the overall expression being evaluated.
Selecting Bind Value? creates a bound expression and makes the second field in Filter Expression come from the same business object as Field in part A.
The Bind Value? check box identifies:
For both Custom Value Expression and Filter Expression, the data types for the values in the compared fields must match. If they do not match, an error occurs when you preview the process or submit a request.
To create standard expressions
You must be in step 2, Specify Step Entry Criteria when creating or editing an approval process step.
- Select the required object record field you will compare from the Field list.
- Select the operator and enter a valid value.
- Click the + or – icon to add or remove additional field expressions. By default, each line is linked with AND. Click Advanced Options to use AND, OR, and parentheses. See Creating Advanced Options for details.
- Click Save once all the expressions have been added.
To create advanced and bound expressions
You must be in step 2: Specify Step Entry Criteria when creating or editing an approval process step.
- From the Field list, select the required object record field you want to compare and select the Operator.
- Select Custom to display the Custom Value Expression options.
Select the required options:
Option Description Object
This custom Salesforce object is a table containing fields used for the expression.
Field This custom object field will be compared against the field and operator selected in step 1. Filter Expression These two fields and operator act as an independent expression within the larger overall expression. Bind Value This enables the third Filter Expression picklist to be populated with values from the same object record that is being used in the main Field picklist.
- Click the green plus icon () to add another line, or click Next or Save to leave the page.
Creating Advanced Options
By default, when you create expressions each of them is associated by AND. This means the criteria for each expression must be met before the approval process will be routed according to the entry criteria, approval step criteria, or term exception approval conditions.
The AND column is read-only and cannot be changed. Select Advanced Options.
Selecting Advanced Options removes the AND column, prepends a number to each expression, and displays the Advanced Filter Condition field. It displays each of the expressions, identified by their number, joined by the default AND.
In the Advanced Filter Condition field, you can use any combination of numbers representing the expressions with AND, OR, or parentheses. These are the only values that can be used. Other values may cause unexpected behavior.
There is no character validation in this free text field. You can use up to 255 characters.
To set advanced options
You must be in one of the following custom object sections:
- Approval Process > Entry Criteria
- Approval Process > Approval Steps > Step Entry Criteria
- After you have created the required expressions, select Advanced Options. The Advanced Filter Condition field is displayed with the expressions listed in sequence, linked by AND.
In the Advanced Filter Condition field, create the equation using only the numbers representing the expressions, AND, OR, and parentheses.
Option Description Valid example ((1 OR 2) AND 4) OR 3 Invalid example ((1 > 2) & (three or 4)) AND 5
- Click Next or Save depending on which custom object you are in.
Initiating an Approval Request
If the object for which you have defined the approval process fulfils the search entry criteria and the step entry defined in the approval process, an approval request is initiated. All line items that require an approval show up with an "approval required" label. To view the object and line items that require an approval, use the Approval button on the object, to view a list of approvals required along with the approvers.