Salesforce Automation Processes - External Training
Salesforce Automation Processes - External Training
Salesforce Automation Processes - External Training
Salesforce provides multiple tools to automate your org’s repetitive business processes:
Workflow Rules
Process Builder
Approval process
Visual Workflow
The automation tool that you need depends on the type of business process that you’re
automating.
Delete records
Update fields
Workflows
Workflow allows you to automate standard internal procedures and processes to save time
across your org. A workflow rule is the main container for a set of workflow instructions. These
instructions can always be summed up in an if/then statement.
1. Criteria: the “if” part of the “if/then” statement. In other words, what must be true of
the record for the workflow rule to execute the associated actions.
2. Actions: the “then” part of the “if/then” statement. In other words, what to do when
the record meets the criteria.
● The object that determines the records the workflow rule cares about. This object
determines the records the workflow evaluates, as well as the fields available for setting
the rule criteria.
● Evaluation criteria that determine which changes trigger the workflow rule—such as
only when accounts are created.
● Rule criteria that identify what must be true about the record for Salesforce to execute
the associated actions. Any change that causes a record to match this criteria can trigger
the workflow rule—even changes to hidden fields.
Example: If an account is created or updated and it’s located in Texas, you want Salesforce
to automatically perform certain actions. Here’s how that if-statement breaks down into
workflow rule criteria.
● An account (object)
● is created or updated (evaluation criteria) and
● is located in Texas (rule criteria)
When a record meets all the criteria for a workflow rule, that rule’s actions are executed. Just
like with criteria, you should know about the different types of actions.
First, figure out when the action should be executed. You have two options.
● Immediate actions, like their name suggests, are executed as soon as the workflow rule
finishes evaluating the record. Example: when a new high-value opportunity is created,
email the opportunity team.
● Time-dependent actions are executed at a specific time, such as ten days before a
record’s close date. When that specific time passes, the workflow rule re-evaluates the
record to make sure that it still meets the rule criteria. If the record does, the workflow
rule executes those actions.
Note: If you selected “created or edited” for your evaluation criteria, you can’t add time-
dependent actions. You can monitor and cancel pending time-dependent actions from Time-
Based Workflow in Setup.
Before you can add a time-dependent action to a workflow rule, you first have to identify when
those scheduled actions should be executed. Enter the time trigger. When you create a time
trigger, you identify a time at which you want Salesforce to execute certain actions. To do so,
you select a date or date/time field and specify an amount of time before or after that field. For
example, the following time trigger starts a month before an account’s service contract expires.
It is equivalent to “now” in a workflow time trigger is “Rule Trigger Date”. For example, if you
want to send an email a week after the workflow rule evaluates this record, select 7 Days After
Rule Trigger Date.
As far as what the action does, here are the different actions that you can add to a workflow
rule. Each of these actions is available as both immediate and time-dependent actions.
● Email Alert—Send an email by referencing an email template. For example, email sales
management when a sales representative qualifies a large deal.
● Task—Create a task. For example, assign follow-up tasks to a support representative.
● Field Update—Update a field on the record that the workflow rule evaluated or a
related record. For example, when a user record is created, set the Active field to true.
● Outbound Message—Send a secure, configurable API message (in XML format) to a
designated listener. For example, send a message to an external HR system to initiate
the reimbursement process for an approved expense report.
Example: If the criteria are met, you want to update the account owner and three days later
assign the account owner a task to call the account’s contact. Here’s how that then-statement
breaks down into workflow actions.
1. From Setup, enter Workflow Rules in the Quick Find box, then select Workflow Rules.
2. Click New Rule.
3. For Object, select Account.
Every workflow rule is directly associated with one and only one object. The object is the
first thing that narrows the scope of a workflow rule, in that it tells the rule that it only
needs to pay attention to these kinds of records. For this example, we’re telling the
workflow rule to look at only accounts.
4. Click Next.
5. Name the workflow rule Texas Accounts. While you’re at it, give it a description, too.
6. In the Evaluation Criteria section, select created, and any time it’s edited to
subsequently meet criteria. The evaluation criteria let you identify which changes you
want the rule to evaluate.
Created Evaluate the rule criteria each time a record is The workflow rule doesn’t handle
created. If the rule criteria is met, run the rule. accounts that move to Texas after
Ignore all updates to existing records. With this their account record is initially
option, the rule never runs more than once per created.
record.
created, and every time Evaluate the rule criteria each time a record is The workflow rule runs every time an
it’s edited created or updated. If the rule criteria is met, run account that’s located in Texas is
the rule. With this option, the rule runs every updated, not just when an account is
single time a record is edited, and it executes updated to be located in Texas. The
immediate actions as long as the record meets workflow would run for irrelevant
the rule criteria. changes, such as the description
being updated. That means that it
would run for both of these cases.
1. Click Edit.
2. In the Time-Dependent Workflow Actions section, click Add Time Trigger.
3. Configure the time trigger to be 1 Day After Rule Trigger Date. For this time trigger,
Salesforce will execute the associated time-dependent actions one day after the rule
evaluates the record.
4. Click on Save
3) Click Done.
Then Activate the Workflow for usage.
You can create as many Field Update, Task, Email Alert, and Outbound Messages actions as you
want. Once you create a workflow action, you can use that action across multiple workflow
rules. To use an existing action on a workflow rule:
1) From Setup, enter Workflow Rules in the Quick Find box, then select Workflow Rules.
2) Select the workflow rule that you want to add the action to.
3) Click Edit.
4) Click Add Workflow Action | Select Existing Action.
5) Select the type of action that you want to add.
6) Move the appropriate actions from Available Actions to Selected Actions by selecting
them and clicking the left arrow.
7) Click Save.
8) Click Done.
Process Builder
The Process Builder tool allows you to easily automate business processes using a convenient
graphical representation of your process as you build it. Automated processes in the Process
Builder consist of:
Any change that causes a record to match the criteria automatically triggers the action group.
Check out this short video to become more familiar with how the Process Builder works.
Before beginning, click around and become familiar with the user interface. From Setup, enter
Process Builder in the Quick Find box, then click Process Builder. First up, click New, name your
process, and click Next. Now you get to a page that looks something like this.
Canvas (2)
The canvas is the main workspace for a process. On the canvas, you can define:
1) From Setup, enter Process Builder in the Quick Find box, click Process Builder, and then
click New.
2) Name the process Opportunity Management. The API name updates to
Opportunity_Management when you tab out of the Name field.
3) For the description, enter If a high-value opportunity is closed and won, create a draft
contract and a follow-up task for the account owner.
4) Click Save.
5) Click Add Object to associate your process with an object and specify when to start the
process. For this process, let’s choose Opportunity and start the process when the
record is created or edited.
6) Click Save.
Add Criteria
Now let’s define the criteria that must be true before the process can execute the associated
actions. For this process, we want to check whether the opportunity has been closed and won,
as well as if it’s high-value. For this example, “high-value” means it’s worth more than
$250,000.
5) Associate the new contract with the opportunity’s parent account by selecting a value
for Account ID.
a. For type, select Reference.
b. Click in the Value box to choose a value.
c. Select Opportunity > Account ID and then click Choose.
An information to be shared: When you select a value without next to it, you're
selecting a field. In this example, we've selected the account field on the opportunity
record. To use fields on other related records, click a value with next to it.
6) Make sure the new contract is a draft. In the Value for Status, select Draft from the
drop-down list.
7) Click Save.
First, set up a schedule. A schedule lets the process know that it must wait to execute the
associated actions. Because you can configure multiple schedules for the same criteria node,
each schedule has its own list of actions to execute.
● Start the process only when a record is created (1). Select this option when you choose
an object for your process.
● Start the process when a record is created or edited (2). In addition, select the advanced
option to execute actions only when specified changes are made (3) when you add
criteria to your process.
3) Click Save.
Now that you have a schedule, add the task creation action to it.
Note:
● Draw out your business process before you try to automate it. Doing so makes it easier
to configure when using one of our tools for process automation.
● When you’re selecting objects or fields, you can type to filter the list of options. For
example, type Opp and then select Opportunity from the filtered list.
Approval Process
Approval process terminology -
Approval Process -
An approval process automates how records are approved in Salesforce. An approval
process specifies each step of approval, including from whom to request approval and what
to do at each point of the process.
Approval Request -
An approval request is an email, Salesforce1 notification, Lightning Experience notification,
or Chatter post. The approval request notifies the recipients that a record was submitted for
them to approve.
Approval Actions -
An approval action occurs when all required approvers approved a step.
Approval Steps -
Approval steps define the chain of approval for a particular approval process. Each step
determines
■ Which records can advance to that step
■ To whom to assign approval requests
■ Whether to let each approver’s delegate respond to the requests
The first step specifies what to do if a record doesn’t advance to that step. Later steps
specify what happens if an approver rejects the request.
Assigned Approver -
The assigned approver is the user responsible for responding to an approval request.
Delegated Approver -
A delegated approver is someone appointed by an assigned approver as an alternate for
approval requests.
Email Approval Response -
Email approval response lets users respond to approval requests by replying to an email
notification.
Initial Submission Actions -
An initial submission action occurs when a user first submits a record for approval. By
default, the record is locked.
Final Approval Actions -
Final approval actions occur when all required approvals were obtained.
Final Rejection Actions -
A final rejection action occurs when an approver rejects the request and it moves to the final
rejection state.
Outbound Message -
An outbound message sends information to a designated endpoint, like an external service.
You can configure outbound messages from Setup. Configure the external endpoint and use
the SOAP API to create a listener for the messages.
Process Instance -
A process instance represents one instance of an approval process. A new process instance
is created each time a record is submitted for approval.
Process Instance Node -
A process instance node represents an instance of an approval step. The system creates a
process instance node each time a record enters a step in an approval process. The system
doesn’t create a process instance node when the record doesn’t meet the step criteria or
the approval process instance is completed without entering the step.
Recall Actions -
A recall action occurs when a submitted approval request is recalled. By default, the record
is unlocked.
Record Locking -
Record locking prevents users from editing a record, regardless of field-level security or
sharing settings. By default, Salesforce locks records that are pending approval. Only admins
can edit locked records.
Firstly, Let us try to understand the difference between Workflow Rules and Approval Process
Salesforce supports wizard based easy to configure approval process. After an object is
selected, the wizard guides the user through a step-by-step setup. Approval process is triggered
when a user clicks on the "Submit for approval" button.
Standard Wizard -
When your approval process is more complex and you want to define specific steps, use the
standard wizard.
1. From Setup, enter Approval Processes in the Quick Find box, then select Approval
Processes.
2. Select an object.
3. Select Create New Approval Process | Use Jump Start Wizard.
4. Configure the approval process by following the wizard.
1. From Setup, enter Approval Processes in the Quick Find box, then select Approval
Processes.
2. Select an object.
3. Select Create New Approval Process | Use Standard Wizard.
Step 1: - Selecting Approval Wizard.
Next specify the entry criteria and this is optional . This option is used to mention which record
should enter the approval process. We can enter formula logic or Selecting certain fields,
operator and value as shown below.
Step 3: - Select Approver Field and Record Editability Properties.
In this step we want to sent automatic approval request to a user called manager so select
manager as shown below.
Visual Workflow
One of the least explored sections of the Salesforce Setup menu is the section labeled
“Flow”. The more I talk to people about it, the more I get curious responses saying, “I know
it’s out there, but I have never tried it.” Flow is a somewhat hidden gem in the
administrator and developer’s tool belt. The time to check out how it could be relevant to
your organization is not when you find spare time; the time is now.
Flow, also known as Visual Flow, is a tool for collecting, processing and updating
information in Salesforce based on business processes. It can be used in the standard
Salesforce app your users are familiar with or deployed to a Salesforce portal or public
website. If you’ve ever drawn a business process in a tool like Visio, designing it in Flow is
very similar. It is easy enough that you don’t have to be a developer to use it, but it has the
capability to use code if you want to expand your Flow to other apps or even reuse Apex
code already available in Salesforce.
As a “business problem solver”, It’s not like one person will ever have all the right answers,
and in fact, with software development, there is always another way to do things which
may just beat out the current idea and accelerate business further. Flow can do just that. It
can augment or replace some standard Salesforce workflow. It can simplify processes, it can
enforce business rules, and it can expand the horizons of what you thought you could do
inside Salesforce. That’s why you need to check it out.
Flows are built from elements. Elements represent actions, such as presenting information
to, or collecting information from, flow users. Elements can also query, create, update, and
delete information in Salesforce. When you connect elements together in the Flow
Designer, you create a flow, or a series of actions that work together to accomplish one or
more tasks. Resources include variables, constants, or formulas and are used to store or
manipulate data within the flow.
● Screen – You can create screens to present or gather data which are, in essence, the
steps to your process
● Decision – These are branches of your Flow that use data inputs and business logic to
move the user to the next logical step in the process
● Assignment – Depending on input and business processes, data variables may need to
be set or reset and assignments ensure the right data is stored to support the business
process
● Data – At various times in a business process, you may need to look for a record or value
in Salesforce. You may also need to create, update, or potentially even delete a record
in Salesforce and that’s when you need the Data component.
● Apex – You can access any Apex code used by other processes in Salesforce or create
new code specific to your Flow
● Flow – Reuse standard flows inside much more complex ones. Any flow can be saved
and referenced inside other flows so you don’t have to recreate your past work to make
use of it
5 Cool Things You Can Do with Salesforce Flow (No Coding Required)
1. Guided Selling
Complex sales processes or ones that require an agent to walk through a
series of questions are tailor-made for Flow. Using Flow to set up screens,
fields, and choices will ensure that our users are entering data in a guided
format and that you're capturing the relevant information. For more on
building a simple Flow using Salesforce visual workflow.
2. Call Scripting
Sales isn’t the only department that can benefit from Flow. We can utilize it
in our Service Centers as well. Flow is great for call scripting where an agent
needs to walk through a series of questions and answers in order to
capture the needed data. If your company utilizes call campaigns and call
down lists, Flow will be your best friend. To watch a demo of call scripting
using Flow.
5. Reduce Training
By utilizing Flow and enforcing users to enter specific information, minor
changes to business processes can be rolled out with minimal adjustments
to training. Now user guides, videos, etc. can all reference prompts the user
should follow to ensure correct data entry. This reduces training time and
increases the speed of onboarding new customers.
When Should I Create a Flow?
We recommend starting with the Process Builder whenever possible. The user interface is
easier to use than the Cloud Flow Designer. The best way to figure out whether you can
start with the Process Builder is to ask yourself, “Do I need to get information from a user?”
● If your answer is No (i.e. it can run completely in the background), start with the Process
Builder. If your process is too complex for what the Process Builder allows you to do,
then use Visual Workflow.
For example, your process doesn’t require user interaction but it needs to evaluate the
record against multiple levels of criteria. When a new contact is created or updated,
make sure that the address is complete. If it isn’t complete, request the full address.
However, some contacts have opted out of phone calls, so check whether the Do Not
Call checkbox is selected. If it is selected, email the contact with a request for the full
address. If it isn’t selected, create a task for the contact owner to follow up with the
contact and update the address.
1) Manage the flow while you’re designing from the button bar (1)
● Test how the flow works as you’ve designed it with Run. Always save first,
though. This button runs the last-saved version of the flow that you have open.
● Return to Setup with Close.
● Manage the flow’s properties, such as its name, description, and interview label,
with Edit Properties.
● Monitor the flow version’s status, as well as whether it has any errors or
warnings, with the indicator on the top right corner.
Draw out your business process before you try to automate it. Doing so makes it easier to
configure when you use one of our tools for process automation.
When you design a flow that creates records, know which of the object’s fields are required at
the field level. The flow doesn’t check for fields required by a page layout. From the flow’s
perspective, a field is required if it’s required by the API (standard fields) or has Required
selected in the field definition (custom fields). If the flow doesn’t supply a value for a required
field, the flow fails and the record isn’t saved. The Cloud Flow Designer doesn’t identify API-
required fields.
If you’re not sure which fields are required, you can look at the Object Reference for Salesforce
and Force.com for standard fields and the object’s definition page for custom fields.
Create a Flow.
1) From Setup, enter Flows in the Quick Find box, then select Flows, and then click New
Flow.
2) Add a screen, where you can collect information from the user who runs the flow.
● From the Palette, drag a Screen element onto the canvas.
● In the General Info tab, name it New Account.
● From the Add a Field tab, double-click Textbox and then double-click Number. A
textbox and a number field appear in the preview pane on the right.
● Select each field in the preview pane and enter the following for each field’s
label.
a) Textbox: Account Name
b) Number: Phone Number
● Click OK to return to the canvas.
3) Create an account by using the values that the user entered for the screen.
● From the Palette, drag a Record Create element to your canvas.
● Name it Create Account.
● In Create, select Standard | Account. When you create other flows, you can
always choose other objects.
● Map the screen input fields to account fields.
● Click Ok
Here’s how the Assignments section of your Record Create element looks.
4) Connect the two elements together by clicking the node at the bottom of the Screen
element and dragging the connector to the Record Create element. As explained earlier,
connectors tell the flow which element to go to next.
5) Identify which element the flow should start at.Because the Record Create element uses
the values entered in the screen’s fields, the Screen element must come first.
Hover over the Screen element’s top right corner.
Click Set
6) Save the flow, and name it Quick Account. The flow’s properties includes some other
information, like Flow Type. Leave the defaults selected.
Here’s what the final flow looks like.
● A flow interview is a running instance of a flow. When you distribute a flow, users
interact with individual interviews of that flow.
● A flow can consist of multiple flow versions. Once you’ve activated a flow, you can’t
make changes to it. You can, however, make the necessary changes to a new version of
that flow and later activate the new version.
Doing More with Flows
This unit walked you through a simple example of a flow. You can customize that flow to do
much more. For example, design the Quick Account flow so that it gives values for more
account fields, like the location or owner.
Deleting Flows
To delete an active flow version, first deactivate it. If a flow has any paused or waiting
interviews, it can’t be deleted until those interviews are finished or deleted. Flows that have
never been activated can be deleted immediately. If you don’t see a Delete button or “Del” link,
not enough time has passed since the flow was deactivated.