Getting Started with Process Builder – Part 25 (Auto Submit Record into Approval Process)

Getting Started with Process Builder – Part 25 (Auto Submit Record into Approval Process)

Last Updated on December 19, 2020 by Rakesh Gupta

To understand how to solve the same business use case using Salesforce Flow. Check out this article Getting Started with Salesforce Flow – Part 31 (Auto Submit Record into Approval Process).

Big Idea or Enduring Question:

How do you automatically submit a record for approval using Process Builder?

Objectives:

After reading this article, you’ll be able to:

  • Create an automation that will automatically submit the record into approval, if it meets the criteria
  • How to use the Submit for Approval action in Process Builder

Business Use case

Warren Mason is working as a System Administrator at Universal Containers (UC). He has created an approval process on the Campaign object. This will work only for those campaigns where the Budgeted Cost is greater than $1M. Now he is looking for a way so that the campaign record will be automatically submitted into the approval process without any manual intervention when it meets the entry criteria.

Automation Champion Approach (I-do):

An approval process is an automated process an organization can use to approve records in Salesforce. To submit a record into the approval process, the user has to manually click on the Submit For Approval button, as shown in the screenshot below.

The disadvantage of this manual process is that a user can forget to click on the Submit For Approval button. It will not auto-send records into the approval process, and therefore, it may cause an issue sometimes. In this article, I am going to discuss how you can use Process Builder to automate this process.

While this can be solved using various automation tools like Apex or Flow, we will use Process Builder. You can also use Apex Triggers as a solution.

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 5 steps to solve Warren’s business requirement using Process Builder. We must: 

  1. Create an approval process 
  2. Define process properties
  3. Define evaluation criteria
  4. Define process criteria 
  5. Add action – submit for approval 

Step 1: Create an Approval Process 

  1. Click Setup.
  2. In the Quick Find box, type Approval Processes.
  3. Clicks on the Create New Approval Process | Use Standard Setup Wizard button
  4. Select the Campaign object for Manage Approval Processes For drop-down. 
  5. Now create an approval process, as shown in the following screenshot:

Step 2: Define Process Properties

  1. Click Setup.
  2. In the Quick Find box, type Process Builder.
  3. Select Process Builder, then click New.
  4. Name the Process and click the Tab button. The API Name will populate. 
  5. As a best practice, always input a description
  6. The process starts when A record changes.
  7. Click Save.

Step 3: Define Evaluation Criteria

  1. Click on the Add Object node to begin selecting the evaluation criteria.
  2. Select the Campaign object from the dropdown list.
  3. Start the process when a record is created or edited.
  4. Click Save.

Step 4: Define Process Criteria

  1. Click the Add Criteria node to begin defining the process criteria.
  2. Name the criteria.
  3. The criteria should execute actions when the conditions are met.
  4. Set Conditions
    1. Row 1
      1. Field: Campaign | IsActive
      2. Operator: Equals
      3. Type: Boolean
      4. Value: True
  5. Click Add Row
    1. Row 2
      1. Field: Campaign | Budgeted Cost in Campaign
      2. Operator: Greater than
      3. Type: Currency
      4. Value: 1,000,000
  6. Select All of the conditions are met (AND)
  7. Click Advanced
  8. Select Yes to execute the actions only when specified changes are made to the record.
  9. Click Save.

The reason why we would select the Yes checkbox for the question — Do you want to execute the actions only when specified changes are made to the record? — is to allow the Process Builder to execute the actions only if the record meets the criteria now, but the values that the record had immediately before it was saved didn’t meet criteria. This means that these actions won’t be executed when irrelevant changes are made.

Step 5: Add Action – Submit for Approval

  1. Below Immediate Actions, click Add Action.
  2. For Action Type, select Submit for Approval
  3. Name the action.
  4. The object automatically populates based on the evaluation criteria from Step 3
  5. Under Approval Process, select Specific Approval Process, then select the Campaign Budget Greater than 1M approval process. 
  6. For Submitter, select Current User. (This field allows you to specify the submitter for the approval request and receives all related information.)
  7. Submission Comments appear in the approval history. They also appear in the initial approval request email if the template uses the {!ApprovalRequest.Comments} merge field. For the purposes of this article though, we will leave this blank. 
  8. Click Save.

Almost there! Once everything looks good, click the Activate button. 

A few key details to remember

  1. When defining the Approval Steps, if you have selected Let the submitter choose the approver manually option (Step 3: Select Assigned Approver ), then Process Builder will not work. You will get a runtime error (i.e., No applicable approval process found).
  2. The record is submitted to the default approval process, and there are no active approval processes for the record’s object type.
  3. The record is submitted to the default approval process, and it doesn’t meet the criteria for any of the approval processes for the record’s object type.
  4. The record is submitted to a specific approval process, and it doesn’t meet the entry criteria.

Proof of Concept

Now onwards, if a business user creates a campaign with a budget amount greater than $1M and makes it active, then Process Builder will automatically trigger and submit the record for the approval process. 

Formative Assessment:

I want to hear from you!  

What is one thing you learned from this post? How do you envision applying this new knowledge in the real world? 

Let me know by Tweeting me at @automationchamp, or find me on LinkedIn.

Have feedback, suggestions for posts, or need more information about Salesforce online training offered by me? Say hello, and leave a message!

7 thoughts on “Getting Started with Process Builder – Part 25 (Auto Submit Record into Approval Process)

  1. Hi There…nice article.

    I had a similar steps , but while saving it doesnt let you save the process builder due to the below error :

    This doesnt help at all—really a vague error mssg : Any idea a way to de-track this? Thanks

    Unfortunately, there was a problem. Please try again. If the problem continues, get in touch with your administrator with the error ID shown here and any other related details. Error ID: 1745027671-25371 (666031899)

      1. Hi,
        I have Approval Process on EmailMessage Object. The EmailMessage record should be auto submitted for approval on creation of an email.I have created Process Builder on Email Message Object which calls ‘Submit For Approval’ action. System is throwing an error as :
        An error occurred at element myRule_1_A1 (FlowActionCall).
        Submit for approval not allowed.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.