Table of Contents
Introduction
As the name suggests, an Approval Process lets us specify a sequence of steps required to approve a record. The Approval Process automates how records are approved, and this includes:
- Whom to request approval from?
- What’s to be done at each step of the process?
Salesforce allows us to specify the following in an approval process:
1. Approval Actions
- Initial Submission Actions
These include the actions executed when a user submits a record for approval. By default, the action, Record Lock, is invoked. This action locks the record from being edited. Additionally, we can create the following approval actions: Task, Email Alert, Field Update, and Outbound Message. - Final Approval Actions
These include the actions executed when a record is approved after the final approval (an approval can consist of multiple steps with multiple user approval required). This action can also lock or unlock a record, as indicated. Additionally, we can create the following final approval actions: Task, Email Alert, Field Update, and Outbound Message. - Final Rejection Actions
These include the actions executed when a record is rejected at any point in the approval steps. This action can also lock or unlock a record, as indicated. Additionally, we can create the following final rejection actions: Task, Email Alert, Field Update, and Outbound Message. - Recall Actions
These include the actions that are executed when a record is recalled during the approval steps. We can create the following recall actions: Task, Email Alert, Field Update, and Outbound Message.
2. Approval Steps
An Approval Process can include one or more steps. Each step can consist of a separate approver as specified.
Let’s understand Approval Steps with the help of an example:
A User submits a request for an Opportunity record Approval. When an Opportunity is given a discount above 30%, the Opportunity must be approved by both the User’s manager and the CEO.
Let’s break down this approval process:
- The User submits an Opportunity record for approval as the discount percentage exceeds 30%. When the User submits the request, the default initial submission action locks the record (only the admin and approvers can update it while it’s pending approval).
- Approval Step #1 – The User’s direct manager receives the approval request. The manager has two options here:
- If the request is Rejected, the final rejection actions are executed, and the approval status is updated to Rejected.
- If the request is Approved, the record moves to Approval Step #2.
- The CEO (Approver #2) can take one of these decisions:
- If the request is Rejected, the final rejection actions are executed, and the approval status is updated to Rejected.
- Suppose the request is Approved by the CEO. In that case, the record status is updated to Approved, the final approval actions are executed, and the record is unlocked.
- The CEO (Approver #2) can take one of these decisions:
Build an Approval Process
Let’s build an approval process in our orgs. The management requires an Opportunity to be approved by the direct manager of the submitter if the Opportunity Discount is greater than 30%.
1. Create an Email Template
Let’s start by creating an email template to notify the submitter’s manager when an opportunity has been discounted by more than 30%.
- In Setup, type Templates in the Quick Find Box, and then click Classic Email Templates.
- Click New Template.
- Select Text for template type and click Next.
- Enter the following:
- Folder: Unified Public Classic Email Templates
- Available for Use: Selected
- Email Template Name: Opportunity Record Approval
- Encoding: General US & Western Europe
- Subject: Please Approve this Discounted Opportunity
- Email Body: ({!User. Manager} is a merge field and can be added to the email body from the available merge fields section) :
{! User.Manager}, The {!Opportunity.Name} has been discounted. Please approve this discount. Thank you.
5. Click Save.
2. Add Custom Fields
Let’s create two custom fields → discount percent and approval status.
- From Setup, open Object Manager and select Opportunity.
- Open Fields & Relationships and click New.
- For Field Type, select Percent, and click Next.
- Enter the following:
- Field Label: Discount Percent
- Required: Selected
- Click Next, Next, and Save & New.
- For Field Type, select Picklist, and click Next.
- Enter the following:
- Field Label: Opportunity Status
- Values: Enter values, one value per line
- Picklist Values:
Approved
Rejected
- Click Next, Next, and Save.
3. Create an Approval Process
We’re onto the final piece of the puzzle. Let’s go ahead and create the Approval Process!
- From Setup, type Approval Processes in the Quick Find Box, and click Approval Processes.
- In Manage Approval Process For, choose Opportunity.
- Click New Approval Process and select Use Jump Start Wizard.
- Enter the following:
- Name: Discounted Opportunity Approval
- Approval Assignment Email Template: Opportunity Record Approval
- Specify Entry Criteria:
- Field: Opportunity: Discount Percent
- Operator: greater than
- Value: 0.3
- Select Approver: Let the submitter choose the Approver manually
5. Click Save and Close.
6. Click View Approval Process Detail Page.
7. Under Final Approval Actions, click Add New and select Field Update.
- Name: Approved
- Field to Update: Opportunity Status
- Picklist Option: A specific value | Approved
- Click Save.
8. Under Final Rejection Actions, click Add New and select Field Update.
- Name: Rejected
- Field to Update: Opportunity Status
- Picklist Option: A specific value | Rejected
- Click Save.
0 Comments