Book Image

Salesforce Process Builder Quick Start Guide

By : Rakesh Gupta
Book Image

Salesforce Process Builder Quick Start Guide

By: Rakesh Gupta

Overview of this book

Salesforce Management System is an information system used in CRM to automate business processes, such as sales and marketing. Process Builder is a visual tool created to automate business processes in Salesforce. It enables users with no coding expertise to build complex Salesforce workflows. The book starts with an introduction to Process Builder, focussing on the building blocks of creating Processes. Then you will learn about different applications of Process Builder for developing streamlined solutions. You will learn how to easily automate business processes and tackle complex business scenarios using Processes. The book explains the workings of the Process Builder so that you can create reusable processes. It also explains how you can migrate existing Workflow Rules to Process Builder. By the end of the book, you will have a clear understanding of how to use Flows and Process Builder to optimize code usage.
Table of Contents (12 chapters)
Title Page
Copyright and Credits
Packt Upsell

An overview of Process Builder

Lightning Process Builder and Process Builder are the same tool. Process Builder provides a way to automate business processes. In other words, it is the upgraded version of the Workflow Rule. Whenever you create a process, the system automatically creates a Flow, and a Flow Trigger to call the Flow. This happens behind the scenes, and the user doesn't need to interact with the shadow Flows. The Workflow Rule has several limitations. It doesn't allow you to update child records. Also, it doesn't allow you to post to Chatter, create a child record on a specific action, or automatically submit a record for approval.

To overcome these limitations, Salesforce introduced Process Builder in its Spring 2015 release. There are a few advantages to Process Builder, which are as follows:

  • It allows you to create a complete process on a single screen, unlike in Workflow Rules, where you have to move from screen to screen to create a complete rule.
  • Its visual layouts allow you to create a complete process using point-and-click.
  • It helps you to minimize Apex code usage.
  • It allows you to call Apex from Process Builder, where Apex is still required.
  • It also allows you to create multiple scheduled actions for the criteria from Process Builder.
  • You can easily reorder process criteria with drag and drop.
  • It is also possible to execute multiple criteria of a process.

As of the Summer 2018 release, Process Builder runs in system mode, so object- and field-level permissions will be ignored for the user that triggers the process. Visual Workflow runs in user mode, which means that at runtime, the user that triggers the Flow, their access on the object, and field the level will be counted. However, if a process is launching a Flow, the whole automation will run in system mode. Let's look at an example; suppose that you are trying to update the opportunity Next Step field:

  1. If you are using Process Builder: If the running user doesn't have access to the Next Step field, Process Builder will be able to update it.
  2. If you are using Flow (a custom button to call a Flow): If the running user doesn't have access to the Next Step field, they will get an error.
  3. If you are using Flow to achieve the same thing, and you are using Process Builder to auto-launch the Flow: If the running user doesn't have access to the Next Step field, then the Flow will be able to update it.

If any of the actions fail at runtime, the entire transaction will fail, and an error message will be displayed. There are some exceptions to this and settings to work around it, which we will discuss inChapter 2, Deploying, Distributing and Debugging your Process

Business problems

As a Salesforce administrator or developer, you may receive multiple requirements from a business, to streamline sales or support processes. If something can't be achieved using Workflow Rule, then you may have to use Apex code to automate it. Let's look at a business scenario.

The use case is as follows: Sara Bareilles is working as a Salesforce administrator at Universal Containers. She has a requirement to auto-update the related contactsOther Phone field with the account Phone, once the account has been activated.

There are several ways to fulfill the preceding business requirement:

  1. To fulfill this business requirement, we could create a Flow and embed it in a Visualforce page. Then, we could use it as an inline Visualforce page in an account page layout.
  2. Since we can't achieve the business requirement using a Workflow Rule, the next possibility is to use an Apex trigger. A developer writes an Apex trigger on an Account object, to update all contacts when the account is activated.
  3. You can also use Process Builder. We will discuss that in detail later in this chapter.

Browser requirements for Process Builder

Process Builder is available for Lightning Essentials and Professional (with a limited number of processes), Lightning Enterprise, Lightning Unlimited, and Lightning Developer editions. You can access Process Builder on any platform. The requirements are as follows:

  • The most recent version of Google Chrome
  • The most recent version of Mozilla Firefox
  • The most recent version of Safari
  • The most recent version of Internet Explorer

Process Builder is 508-compliant, which means that all users, regardless of disability status, can access Process Builder, with one exception:

They can close modal dialogs using the ESC key on their keyboard, but they can’t close side panels by using the ESC key.

An overview of the Process Builder user interface

Process Builder is a tool that allows you to implement business requirements by creating processes (without any code). It has almost all of the features that are offered by Workflow Rule, and it also contains some new features, such as Post to Chatter, Launch a FlowCreate a RecordUpdate Records, and Submit for Approval. From now on, we will use Lightning Experience to create or manage processes using Process Builder, and to create or manage Visual Workflows. The Process Builder user interface has different functional parts, which are shown in the following screenshot:

The different functional parts of the user interface of Process Builder are as follows:

  1. Button bar: The following are the buttons available in the button bar:
    • Activate: Use this button to activate your process. You can't make any changes once a process is activated.
    • Deactivate: This button is available on the button bar only if the process is activated. Use this button to deactivate a process.
    • Edit Properties: This will show you the Process Name, API Name, and Description fields of your process. It allows you to change the process name and description, as long as the process is not activated. You can't change the API Name field after you've saved it for the first time. The Properties window will look as follows:
    • Clone: The Clone button lets you make a copy of the current process. You will be given two Clone As options – Version of current process and A new process.
    • View All Processes: When you click on this button, it will redirect you to the Processes Management page. From there, you can see all of the processes created in the current Salesforce organization.
    • Collapse All: Collapse all actions on the canvas.
    • Expand All: Expand all actions on the canvas.
  1. Process canvas: This is the main area, where you can use point-and-click to develop a process. To edit any element on the process canvas, double-click on it.
  2. Add object: Select the object upon which you want to create a process, and choose the evaluation criteria (the changes that will cause the process to run).
  3. Add criteria: Use this to define the criteria and set the filter conditions.
  4. IMMEDIATE ACTIONS: Use this to define immediate actions for the process.
  5. SCHEDULED ACTIONS: Use this to define scheduled actions for the process.

Actions available in Process Builder

Process Builder can perform almost all of the actions that are available for Workflow Rules, and it also contains some new actions. It doesn't support outbound messages, among other things. With Process Builder, you can perform the following actions:

  • Apex: This allows you to call an Apex class that contains an invocable method.
  • Create a Record: Using this, you can create a record.
  • Email Alerts: Use this to send email alerts.
  • Flows: Use this action to call a Flow from the Process.
  • Post to Chatter: Use this to post a textpost on a Chatter group, a record, or a user's wall.
  • Processes: Use this action to call an existing process from another process.
  • Quick Actions: Use this action to call a Chatter global action or object specific action; for example, log a call, create a record, and so on.
  • Submit for Approval: Use this action to submit a record to an Approval Process.
  • Update Records: This allows you to update any related records.

In this and the following chapters, we will see each action in detail.