Automatically Launch a Salesforce Approval Processes

Share this article...

Translated by Nicholas Fiorendi from salesforcespain.com

In this post, I will show you how to supercharge your business approvals by combining your Salesforce approval processes with the wonderful world of Process Builder. Process Builder can be used to automatically launch Approval Processes; using point-and-click functionality, it’s a powerful alternative to Apex code.

We will focus on covering a specific business need: launching an approval process automatically, without manual intervention from a user. In addition, we will see how we can skip the entry criteria of the process,  to make it more interesting.

If this is the first time you have heard about Process Builder, I encourage you to take a look at this great introductory Trailhead unit: Automate Basic Business Processes with Process Builder

Why Would You Need This Solution?

We need to be able to create an approval process on our Account object, with the aim of having a certain group of managers review sensitive information as part of an account registration process, without leaving the platform. In our hypothetical company, for some business or technical reason, for some business or technical reason, it’s not possible to do this through the user interface with the ‘Submit for Approval’ button. The objective is to launch the process automatically, and also not interfere with the rest of the processes that we already defined on the Account object.

In addition to this we would like to:

  1. Send emails to users
  2. Create a chatter post about the account registration once the information is reviewed
  3. Update certain data

These requirements point to a clear and clean solution: an Approval Process + Process Builder.

What About Mixing Approval Processes?

As we know, Salesforce allows us to create multiple approval processes on the same object. The recommendation they give us is to always use exclusionary entry criteria so that they do not interfere with each other according to their order of execution. Basically, this means that you should not reuse the same entry criteria in more than one approval process.

In addition, each process can be reordered according to our needs. In this way, when a record is sent for approval, either via the user interface or by Apex, it evaluates all the defined processes, in the order they are defined.

Process Builder allows you to launch specific approval processes without evaluating each and every one of the processes defined on an object. Now that we have all this information, our challenge is to find a way to launch an approval process with entry criteria that isn’t being triggered by a user’s actions. So, we will make sure that when launching it by interface or by Apex, that process would never be evaluated and we could run it without problem from our Process Builder, using the option of ‘Skip the entry criteria for this process’.

Let’s Build!

Part 1: The Approval Process

We define the process such that the entry criteria is always FALSE:

Once this is done, we can add the actions the process should take (eg. Email Alerts, Field Updates, etc.):

Part 2: The Process Builder

Salesforce recommends having a Process Builder per object; therefore, you could reuse one of your already active processes, and then establish the correct entry criteria.

In the Process Builder actions, select ‘Submit for Approval’ and select the approval process. The option ‘Skip the entry criteria for this process’ appears once you have selected your process:

Save and Activate. Now with a certain record change, you can launch a specific approval process by skipping the entry criteria!

Leave a Reply