Big Idea or Enduring Question:
Is your Org cluttered with pending approval requests? Why not reassign the requests to a User (Chief Financial officer) or Queue? Ah, a clean org does feel good, doesn’t it?! Awesome!
An approval process is an automated process an organization can use to approve records in Salesforce. One can create, either a one-step or a multi-step, approval process in Salesforce based on business needs.
In the past, I have written a few articles related to the Approval Process and automation. Why not check them out while you are at it?!
- Getting Started with Salesforce Flow – Part 43 (Dynamic Approval Routing in Salesforce)
- Getting Started with Salesforce Flow – Part 31 (Auto Submit Record into Approval Process with Flow)
- Getting Started with Process Builder – Part 98 (What say? Send an Opportunity Approval Request to a Queue? Really?)
- Getting Started with Process Builder – Part 25 (Auto Submit Record into Approval Process)
Let us take a simple use case – Auto-Reassign Pending Request to Record Owner’s Manager.
Wait a minute, you yell! I know Salesforce enough to know that an approval request cannot be auto-reassigned to anyone unless there is automation. I know you know! So, in this article, let us learn how to create an automation process to auto-reassign the approval process!
Objectives:
After reading this article, you’ll be able to:
- Use Schedule-Triggered Flow to check for pending approval requests
- Use Schedule-Triggered Flow to automatically re-assign pending approval requests to a user
Business Use case
Warren Mason, Gurukul on Cloud (GoC) awesome System Administrator, received the following requirement – develop an automated process (Which runs every morning at 08:00 am) that will automatically assign pending approval to the company’s Chief Financial officer (Nathan Gilmore) after 6 days of its initial submission if, by then, the approval is still pending.
Automation Champion Approach (I-do):
While this can be solved using various automation tools like Apex, etc, we will use Scheduled-Triggered Flow.
Before proceeding ahead, you have to understand the ProcessInstanceWorkItem object. It represents a user’s pending approval request.
Field Name | Details |
ActorId | The Id of the user who is currently responsible for approving an approval request. |
OriginalActorId | The Id of the user who was originally assigned this approval request. |
SystemModstamp | It is the date and time when a record was last modified by a User or by an automated process (such as a trigger.) |
Before discussing the solution, let me show you a diagram of a Process Flow at a high level. Please spend a few minutes to go through the following Flow diagram and understand it. Let’s begin building this automation process.
Guided Practice (We-do):
There are 7 steps to solve Warren’s business requirement using Schedule-Triggered Flow. We must: Read the rest of this entry!