Lightning Process Builder: How to Initiate the Approval Process

October 16, 2015 Appirio

By Rahul Agrawal


Salesforce’s Spring 15 release launched a new feature called Lightning Process Builder. Process Builder provides an array of actions that are executed whenever a predefined criteria is matched. Below is a list of actions provided by Process Builder:

  • Create record (now available for other objects, rather than only for tasks)
  • Update record (allows multiple fields to be updated in one action)
  • Initiate flow execution
  • Quick actions (invokes object-related or global action)
  • Email alert
  • Post to Chatter
  • Call Apex (a new feature which enables you to do many things with power of Apex)
  • Submit for approval (initiates an approval process… which we’ll be talking more about in the next section)

Approvals through Process Builder

In the following example, we are exploring the submitted approval of a record using Process Builder — all without writing any code!

In this example, we have a requirement that says “no user is allowed to delete the account record except for a system administrator.” Other users can send a request to delete any account record to the system administrator, and then the system administrator will approve or deny their request. Once the user requests to have an account record deleted, the record then becomes locked, so no changes can be made until the system administrator approves or denies the request.

To meet this requirement, I need to execute an approval process for once a user clicks on the “Request delete” button. Typically, I need to write code to initiate the approval process. But here the customer wants minimum customization and Apex code. This is where Process Builder comes in especially handy.

This requirement is implemented in multiple steps. Here are the approval process steps:

  1. Create a checkbox field named “Request_Delete__c” on the account object.
  1. Create a custom detail page button and update “Request_Delete__c” with the true value.
  1. Create an approval process (sample approval process name: “DeleteAccountApproval”).
  1. Create the Process Builder request.
    1. Go to Setup ⇒ Build ⇒ Create ⇒ Workflow & Approvals ⇒ Process Builder
    2. Click on “New” or an existing Process Builder name to open.LP1
  1. Set object:LP2
  1. Click on “Add Object” and select the object you want Process Builder to create. Here, we are selecting “Account” as the object name.
  1. Add entry filter criteria:LP3
  1. With “Add Action,” we will make the approval process fire when entry criteria is met.LP4
  1. Click on “Save” and activate Process Builder.

I used Process Builder in this scenario because it is easy to use and maintain. Additionally, it doesn’t require Apex code in order to initiate the approval process, which saves a considerable amount of time and energy. And with Process Builder, logic changes are easily configurable and the pictorial form of data flow is easy to understand — both things that make the entire approval process simpler and more efficient than before.



Previous Article
Is Full Regression Testing Required in Agile Development?
Is Full Regression Testing Required in Agile Development?

By Neerav Patel One of the most important features of Agile Development methodology is the client review/de...

Next Article
Duplicate Management by Salesforce: Bypassing Certain Rules
Duplicate Management by Salesforce: Bypassing Certain Rules

By Naresh Kumar Ojha It’s quite interesting to work on Duplicate Management on Salesforce orgs. Preventing ...