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.


ExpressionDescription
StandardThis 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.
AdvancedThis 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.
BoundThe 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.

Bound Expression 


A

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.

B

Selecting Custom enables the Custom Value Expression section for creating advanced and bound expressions. It also sets Value to a read-only "NA".

C

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.

D

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.

E

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:

  • A specific field on the custom object and compares it to a field on the context object.
  • A unique record on the custom object that needs to be used in the step entry criteria.

Attention

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.

  1. Select the required object record field you will compare from the Field list.
  2. Select the operator and enter a valid value.
  3. Click the + or – icon to add or remove additional field expressions. By default, each line is linked with AND. Click Advanced Options to use ANDOR, and parentheses. See Creating Advanced Options for details.
  4. 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.

  1. From the Field list, select the required object record field you want to compare and select the Operator.
  2. Select Custom to display the Custom Value Expression options.
  3. Select the required options:

    OptionDescription
    Object

    This custom Salesforce object is a table containing fields used for the expression.

    Note

    These must have been added using Approvals System Properties. See Setting Up Custom Assignee Value Expression Objects for details.

    FieldThis custom object field will be compared against the field and operator selected in step 1.
    Filter ExpressionThese two fields and operator act as an independent expression within the larger overall expression.
    Bind ValueThis 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.
  4. 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 ANDOR, 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
  1. 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.
  2. In the Advanced Filter Condition field, create the equation using only the numbers representing the expressions, ANDOR, and parentheses.

    OptionDescription
    Valid example((1 OR 2) AND 4) OR 3
    Invalid example((1 > 2) & (three or 4)) AND 5
  3. Click Next or Save depending on which custom object you are in.
The expressions are linked and evaluated according to the formula in the Advanced Filter Condition field. There is no auto-validation on the formula. Test the resulting criteria before using them in a live environment.
To remove the advanced options and return to expressions that are all linked by AND, click Clear Advanced Options.

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.