Skip to main content
Build the future with Agentforce at TDX in San Francisco or on Salesforce+ on March 5–6. Register now.

Manage Approval Logic with Approval Rules, Conditions, and Variables

Learning Objectives

After completing this unit, you’ll be able to:

  • Review business requirements and convert them to an approval rule with logical conditions.
  • Use approval variables to summarize data from a child object for use in the parent object’s approval rules.
  • Use the Tracked Field object to review changes made to an approval condition’s tested field over time.

What Are Approval Rules?

Approval rules are the building blocks of the advanced approval process. Each rule defines an approver and one or more conditions for a record. If the record meets the rule’s conditions when the sales rep submits it for approval, Salesforce CPQ sends an approval request email to the approver.

We recommend evaluating your business requirements and determining how you want to represent them as approval rules. For example, you may want your accounting department to review all high-total quotes. This way, your organization ensures that there’s oversight into the services delivered to customers making large purchases, which reduces the likelihood of costly refunds if services are unavailable.

Let’s look at a few basic approval rule examples.

  • If your sales rep submits a quote with a net total over $100,000, your approval rule sends approval request emails to your company’s accounting department.
  • If your sales rep submits a quote that contains over 10 premium servers, your approval rule sends an approval request email to your company’s VP of Information Technology.

You can also include several conditions on one rule and evaluate them based on conditional logic.

  • Your rule fires only if one of the following conditions is true:
    • The quote has a net total of $500,000 or greater.
    • The quote has over 500 line items.
  • Your rule fires only if the first condition is true and the second condition is false:
    • The quote contains a 500KW generator.
    • The quote doesn’t contain a warranty.

After you’ve configured your approval rules, click Preview Approval on a record to view the Preview Approvals chart, which shows all the active approval rules that an approval request for the object would trigger.

Approval Conditions

An approver receives an approval request when a submitted record causes an approval rule to meet its approval conditions relative to the rule’s Conditions Met field. All approval rules require at least one condition. Use approval condition fields to create a logical statement for the Advanced Approvals package to evaluate. Let’s look at a few important condition fields.

  • Filter Field: Provide a lookup to a field. The condition evaluates its tested field or variable against this field.
  • Filter Type: The type of filter that the condition tests against.
  • Filter Value: Enter a text value. The condition evaluates its tested field or variable against this static value.
  • Filter Variable: Provide a lookup to an approval variable. The condition evaluates its tested field or variable against this variable.
  • Index: If the approval rule evaluates several conditions in a logical statement, provide a value for referencing each condition in the statement. For example, you assign an index value of 1 and use it in the statement 1 OR (2 AND 3).
  • Operator: The operator used to compare the condition’s tested field or tested variable against the filter field or filter value.
  • Tested Field: The condition evaluates this field against the condition’s filter field, filter value, or filter variable.
  • Tested Variable: The condition evaluates this approval variable against the condition’s filter field, filter value, or filter variable.

This condition evaluates whether the quote’s Net Amount field has a value over 1,000.

  • Tested Field: SBQQ__NetAmount__c
  • Operator: Greater Than
  • Filter Type: Value
  • Filter Value: 1000

Advanced Conditions

If your approval rule has multiple conditions, reference them in the rule’s Advanced Condition field to create conditional logic for your rule. Reference each condition by its index value. During approval rule evaluation, Advanced Approvals sends a record for approval if its Advanced Condition logic evaluates to True.

You want a quote to require approval if it has either an Extended Warranty or both a Premium Workstation and a Standard Warranty. Here’s one way to configure your rule and its conditions.

Approval Rule:

Advanced Condition: 1 OR (2 AND 3)

Condition 1:

  • Tested Field: SBQQ__ProductName__c
  • Operator: Equals
  • Filter Type: Value
  • Filter Value: Extended Warranty
  • Index: 1

Condition 2:

  • Tested Field: SBQQ__ProductName__c
  • Operator: Equals
  • Filter Type: Value
  • Filter Value: Premium Workstation
  • Index: 2

Condition 3:

  • Tested Field: SBQQ__ProductName__c
  • Operator: Equals
  • Filter Type: Value
  • Filter Value: Standard Warranty
  • Index: 3

A warranty evaluation approval rule with custom conditions enabled and an advanced condition.

The approval conditions in the warranty evaluation approval rule's related list.

Approval Variables

Approval variables are child objects of approval rules. They aggregate data from child records for evaluation in an approval condition. Advanced Approvals evaluates them in real time along with the approval condition. They provide an easier way to aggregate data in approval conditions when compared to roll-up summary fields or Apex Triggers that aggregate data and send it to a field on the object evaluated for approval. For example, your approval variable can summarize the total number of opportunity products that contain “Premium” in their name across your opportunity.

Important Approval Variable Fields

  • Aggregate Field: Your approval variable performs the aggregate function’s action on this field. For example, if you want to find the average partner discount across all your quote lines, your example looks up to your quote line’s Partner Discount field.
  • Aggregate Function: Pick the math function to perform on your aggregate field.
  • Filter Field: Pick a field if you want to filter your target object based on a certain value. For example, you can evaluate only quote lines with a Product Family field set to Hardware.
  • Filter Value: Pick a value if you’re filtering your target object.
  • Operator: Choose the operator to use with your filter.
  • Target Object: Specify the child object that this variable aggregates. The child object must have a lookup or master-detail relationship with the object that a user is submitting for approval.
  • Type: Choose between summary and discount approval variables. Summary approval variables evaluate several fields, while discount approval variables evaluate a list price and a net price. If you’re using a summary approval variable, provide values for the Filter Field and Filter Value fields. If you’re using a discount approval variable, provide values for the List Variable and Net Variable fields.

This approval variable returns the highest quantity value among opportunity product lines that contain “W012671” in their product code field.

  • Target Object: Opportunity Product
  • Aggregate Field: Quantity
  • Aggregate Function: Max
  • Filter Field: ProductCode
  • Filter Value: W012671
  • Operator: Equals
  • Type: Summary

Tracked Fields

The Tracked Field object on an approval rule tracks changes to a field on a record that a sales rep submitted for approval. When the approval rule runs, Advanced Approvals stores information about the change in a Tracked Value record. Approvers can review tracked values to see what changes were made at various stages of the approval process.

To create a tracked field, go to your approval rule’s Tracked fields related list and click New, then fill out the following fields.

  • Tracked Object: The object containing the field that you want to track. By default, you can choose opportunities. If you want to track a field on a different object, add the object’s value and API name to this field.
  • Tracked Field: The field that the approval rule monitors for changes. It must be a field on the tracked object.
  • Tracking Type: Select Any Values to have Advanced Approvals create a tracked value any time the parent approval rule runs, regardless of whether the tracked field changed.

Approval rules are the backbone of the Advanced Approvals process. Configuring your approval conditions, variables, and tracked fields will help determine the exact requirements for approvers to receive an approval request. In the next unit, we set up approval chains that allow approvers to receive requests only if another user or group of users have already accepted the approval.

Resources

Salesforce 도움말에서 Trailhead 피드백을 공유하세요.

Trailhead에 관한 여러분의 의견에 귀 기울이겠습니다. 이제 Salesforce 도움말 사이트에서 언제든지 새로운 피드백 양식을 작성할 수 있습니다.

자세히 알아보기 의견 공유하기