Lightning Process Builder. salesforce Winter '18
Advertisement
Advertisement
Extend Salesforce with Clicks, Not Code
Process Builder
Send email
Visual Workflow Workflow
Lightning Process Builder
Approvals
(Email alerts only)
Send outbound messages without code
Submit for approval
Update fields
Any related record
(Email alerts only) (Email alerts only)
Any record The record or its parent
The record or its parent
1
The Process Builder has superseded flow trigger workflow actions, previously available in a pilot program. Orgs that are using flow trigger workflow actions can continue to create and edit them, but they aren’t available for new orgs.
Lightning Process Builder
Many of the tasks you assign, the emails you send, and other record updates are vital parts of your standard processes. Instead of doing this repetitive work manually, you can configure processes to do it automatically. Process Builder helps you automate your business processes and gives you a graphical representation as you build it.
Process Builder supports three types of processes for your automation needs. The type determines what triggers the process.
•
A record change process starts when a record is created or updated.
•
An event process starts when a platform event occurs.
•
An invocable process starts when something else, like another process, invokes it.
Each process consists of:
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Professional,
Enterprise, Performance,
Unlimited, and Developer
Editions
•
Criteria that determine when to execute an action group.
•
Action groups, which consist of immediate or scheduled actions. Only record change processes support scheduled actions.
Process Builder vs. Workflow
Use the more powerful and flexible Process Builder to perform the same actions as Workflow. With Process Builder, you can:
•
Create a record of any object type
•
Update any related record—not just the record or its parent
•
Use a quick action to create a record, update a record, or log a call
•
Invoke a process from another process
•
Launch a flow—you can’t schedule this action with workflow
•
Send an email
•
Post to Chatter
357
Extend Salesforce with Clicks, Not Code Lightning Process Builder
•
Submit a record for approval
If you need your process to do more than what process actions allow, don’t worry. You can also call Apex or a flow from a process.
Sample Process: Opportunity Management
This example automates a single business process by using the Process Builder instead of workflow rules.
Sample Process: Printer Management
The example demonstrates how you can use Process Builder to subscribe to and evaluate a platform event.
Process Limits and Considerations
Before you start creating, managing, and activating processes, understand the limits and considerations.
Setting Values in the Process Builder
Throughout the Process Builder, you need to set values, for example, to set conditions in a criteria node, to set the fields on a new case in a Create a Record action, or to specify an Apex method to reference.
Setting Advanced Options in the Process Builder
The Process Builder lets you choose some advanced options for executing actions in your processes.
To create a process, define its properties and which records it should evaluate, and then add criteria nodes and actions.
Use the error messages that appear in the Process Builder and the emails you receive when a process fails to help solve problems that arise when you’re working with processes. When all else fails, look at the Apex debug logs for your processes.
SEE ALSO:
Which Automation Tool Do I Use?
Sample Process: Opportunity Management
This example automates a single business process by using the Process Builder instead of workflow rules.
The example demonstrates how you can use the Process Builder to automate a single process by adding multiple groups of criteria and then associating individual actions with those criteria. In addition, some actions are available with the Process Builder that you can’t perform with workflow rules, such as creating records.
In this example, the process is defined to start when an opportunity record (1) is created or edited.
Three criteria nodes are then set up to check whether a high-value deal was won (2), a high-value deal was lost (3), or a quote was given (4). For the first criteria node that evaluates to true, the associated action group is executed.
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Professional,
Enterprise, Performance,
Unlimited, and Developer
Editions
358
Extend Salesforce with Clicks, Not Code Lightning Process Builder
The High Value Deal Won criteria checks whether the opportunity’s stage is closed and won and also whether the opportunity’s amount is greater than $1,000,000.00. If both of these conditions are met, the associated action group is executed. For this criteria node, three immediate actions (5) and one scheduled action (6) are defined.
These actions:
•
Create a draft contract record that's associated with the opportunity’s account.
•
Congratulate the opportunity owner for closing and winning the opportunity by posting to the Sales Chatter group.
•
Notify the VP of sales via email that the opportunity was closed and won.
•
Create a high priority follow-up task for the associated account’s owner, which is scheduled to execute six days after the opportunity’s
Close Date
.
If the High Value Deal Won criteria conditions aren’t met, the associated group of actions doesn’t execute and the next criteria node
(High Value Deal Lost) is evaluated.
The High Value Deal Lost criteria node checks whether the opportunity stage is closed and lost and whether the opportunity amount is greater than or equal to $1,000,000.00. If these conditions are true, we’ve set up an action (7) to notify the VP of sales by creating a chatter post on the opportunity record. The post identifies the opportunity and the opportunity amount that was lost.
If neither of the previous criteria conditions are met, the next criteria node defined in this process checks whether the opportunity stage is set to “Proposal/Quote Given.” If this condition is true, a scheduled action (8) is executed three days after the record is updated. The scheduled action creates a follow-up task for the opportunity owner to make a call to inquire about the opportunity.
Using the Process Builder, we’ve combined three criteria nodes and associated actions into a single, automated process. To automate the same business process with workflow, you would have to create three different workflow rules and use Apex triggers to create the contract record and post to the Sales Chatter group.
359
Extend Salesforce with Clicks, Not Code Lightning Process Builder
Sample Process: Printer Management
The example demonstrates how you can use Process Builder to subscribe to and evaluate a platform event.
Using platform events and the Salesforce REST API, your printer publishes a Printer Status event at the end of each work day. This event includes the printer’s serial number, how much ink and paper it has, and how many pages it has printed in total.
When Salesforce receives the Printer Status event, your Printer Management process uses the serial number to find a matching asset in your Salesforce org.
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Enterprise,
Performance, Unlimited, and Developer Editions
If the process finds a match, it evaluates the event’s data.
•
The first criteria always update the asset’s print count.
•
The second criteria checks if the ink is low. If so, it launches a flow that orders more ink and assigns a service technician to install the ink cartridge.
•
The third criteria checks if the paper is low. If so, it launches a flow that orders more paper and assigns a service technician to add the paper.
360
Extend Salesforce with Clicks, Not Code Lightning Process Builder
SEE ALSO:
Platform Events Developer Guide: Considerations
Process Limits and Considerations
Before you start creating, managing, and activating processes, understand the limits and considerations.
When building processes, keep shared limits and Apex governor limits in mind. In addition, a process’s API name must be unique across all processes and flows in your org.
When Do Processes Evaluate Record Changes?
Processes start automatically and are invisible to the user. Before you design or activate a process, understand which changes trigger processes.
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Professional,
Enterprise, Performance,
Unlimited, and Developer
Editions
361
Extend Salesforce with Clicks, Not Code Lightning Process Builder
Considerations for Designing Processes
Before you design a process, understand the limitations and guidelines.
Considerations for Managing Processes
Understand what happens when you install, activate, or delete processes.
Considerations for Deploying Processes
Keep these considerations in mind when deploying processes, such as when using packages or change sets.
Process Limits
When building processes, keep shared limits and Apex governor limits in mind. In addition, a process’s API name must be unique across all processes and flows in your org.
Limits Shared with Other Features
Processes share some limits with rules and flows.
Description
Total number of active rules and active processes per object
Rules include workflow rules, escalation rules, assignment rules, and auto-assignment rules. Invocable processes don’t count toward this limit.
Per-Org Limit
50
Total number of flows and processes (including event processes)
Total number of active flows and processes (including event processes)
Total number of event processes
1,000
500
500
Total number of active event processes
Total number of criteria nodes that are evaluated and actions that are executed at runtime
Total number of flow interviews that are resumed or groups of scheduled actions that are executed per hour
Total number of flow interviews or groups of scheduled actions that are waiting to be processed
50
2,000
1,000
30,000
Total number of relative time alarms defined in flow versions or schedules based on a field value in processes
20,000
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Professional,
Enterprise, Performance,
Unlimited, and Developer
Editions
The daily limit for emails sent from email alerts is 1,000 per standard Salesforce license per org, except for Developer Edition orgs. For a
Developer Edition org, the daily workflow email limit is 15 per standard Salesforce license. The overall org limit is 2,000,000, which is shared across all features that use workflow email alerts: workflow rules, approval processes, flows, and processes.
Apex Governors and Limits for Processes
Salesforce strictly enforces limits to ensure that runaway processes don’t monopolize shared resources in the multitenant environment.
Processes are governed by the per-transaction limits that are enforced by Apex. If the process causes the transaction to exceed governor
362
Extend Salesforce with Clicks, Not Code Lightning Process Builder limits, the system rolls back the entire transaction. For details about the operations that are included in the transaction, see “Triggers and Order of Execution” in the Apex Developer Guide.
Description
Total number of SOQL queries issued
Total number of records retrieved by SOQL queries
Total number of DML statements issued
Total number of records processed as a result of DML statements
Per-Transaction Limit
100
50,000
150
10,000
Each Create a Record action uses one DML statement. Each Quick Action action uses one DML statement. Each Update Records action uses one SOQL query and one DML statement. Each Flows action can use multiple SOQL queries and DML statements, depending on the elements that the flow executes. For details, see
on page 415.
Limits for Creating and Managing Processes
Consider these limits when creating and managing processes.
Description
Total number of characters in a process name
Total number of characters in a process’s API name
Total number of versions of a process
Total number of criteria nodes in a process
77
50
Limit
255
200
When Do Processes Evaluate Record Changes?
Processes start automatically and are invisible to the user. Before you design or activate a process, understand which changes trigger processes.
A record change can apply to more than just processes. When a record is created or edited, Salesforce evaluates whether to run other setup items, such as validation rules on the record. Salesforce evaluates the setup items in this order.
1. Validation rules
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
2. Assignment rules
3. Auto-response rules
4. Workflow rules and processes (and their immediate actions)
5. Escalation rules
Available in: Professional,
Enterprise, Performance,
Unlimited, and Developer
Editions
For more information, see Triggers and Order of Execution in the Apex Developer Guide.
When you create a process, you associate the process with exactly one object. You also specify whether to evaluate only created records or both created and edited records. When you activate a process, it starts when a record change meets those settings.
Processes Evaluate Record Changes When:
•
A record is saved or created. Processes that are created after records are saved don’t evaluate those records retroactively.
363
Extend Salesforce with Clicks, Not Code Lightning Process Builder
•
A standard object in a master-detail relationship is reparented.
•
Users synchronize records that were changed while using Connect Offline.
•
Leads are converted, if the lead setting Require Validation for Converted Leads is enabled.
•
.
Processes can reevaluate records up to five times in one transaction. In a batch update, processes reevaluate only changed records.
Note:
A record change can trigger more than one process. You can’t determine which process starts first.
Processes Don’t Evaluate Record Changes When:
•
Campaign statistic fields, such as individual campaign statistics or campaign hierarchy statistics, are updated.
•
Picklist values are mass replaced.
•
Address fields are mass updated.
•
Divisions are mass updated.
•
Territory assignments of accounts and opportunities are modified.
•
Self-Service Portal, Customer Portal, or partner portal users are deactivated.
•
State and country data are converted with the Convert tool.
•
Values for state and country picklists are modified using
AddressSettings
in the Metadata API.
Considerations for Designing Processes
Before you design a process, understand the limitations and guidelines.
EDITIONS
Tip:
We recommend that you use the most recent stable version of Google Chrome
™
.
Best Practices for Designing Processes
Before you design a process, understand the best practices.
Process Builder Accessibility Considerations
Process Builder is 508-compliant, with one exception. You can’t close modal dialogs with your keyboard.
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Professional,
Enterprise, Performance,
Unlimited, and Developer
Editions
Considerations for Event Processes
These considerations are specific to processes that start when a platform event occurs.
Compatibility Considerations for Processes
Before you design a process, understand how processes interact with other Salesforce features, like custom objects and fields.
Formulas that are used as conditions in a criteria node have some limitations. If a process contains an invalid formula, you can’t save or activate the process.
Considerations for Scheduling Process Actions
Scheduled actions are supported only in processes that start when a record changes. The record is processed according to the type of schedule, whether the field changed, and whether the process was deactivated.
Considerations for Processes That Post to Chatter
The Post to Chatter action doesn’t support communities, and there are some limitations around what you put in the message.
364
Extend Salesforce with Clicks, Not Code Lightning Process Builder
Considerations for Processes That Update Records
Understand what happens when you change a record owner, update the same field multiple times, or update currency fields in a multiple currency org.
Best Practices for Designing Processes
Before you design a process, understand the best practices.
•
For an object, use either workflow rules or processes. If you use both, you can’t predict the order in which they’re executed.
•
Make sure that your processes don’t generate infinite loops.
For example, an Update Records action for Process1 triggers Process2, and a Create a Record action for Process2 triggers Process1. The looping causes your org to exceed its hourly limits.
•
If you replace a workflow rule with a process, deactivate the workflow rule when you activate the process. Otherwise, you can get unexpected results, such as overwritten records or redundant email messages. This best practice also applies to Apex triggers.
Process Builder Accessibility Considerations
Process Builder is 508-compliant, with one exception. You can’t close modal dialogs with your keyboard.
Close UI Elements with the Esc key
You can close modal dialogs using the Esc key on your keyboard, but you can’t close side panels.
Reorder Criteria Nodes
To reorder criteria nodes with your keyboard:
1. Select a criteria node by pressing the Space key.
2. Change the order of a criteria node by using the Up and Down arrow keys.
3. Save your changes by pressing the Space key.
4. Cancel by pressing the Esc key.
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Professional,
Enterprise, Performance,
Unlimited, and Developer
Editions
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Professional,
Enterprise, Performance,
Unlimited, and Developer
Editions
Considerations for Event Processes
These considerations are specific to processes that start when a platform event occurs.
Formulas
.
Scheduled Actions
Scheduled actions aren’t supported.
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Associating with a Record
Use the process’s matching conditions to find exactly one record. If the process can’t find one record based on your matching conditions—because either it found multiple records or no records—the creator of the process receives an error email. If an error occurs, adjust the conditions in the process’s trigger to be more specific.
Available in: Enterprise,
Performance, Unlimited, and Developer Editions
Creating Event Messages
With event processes, we don’t block you from creating the same event message that starts the process. To avoid creating an endless loop, make sure that the new event message’s field values don’t meet the filter criteria for the associated criteria node.
365
Extend Salesforce with Clicks, Not Code Lightning Process Builder
Subscriptions Related List
On the platform event’s detail page, the Subscription related list shows which entities are waiting for notifications of that platform event to occur. If active event processes are associated with the platform event, you see a row in which Subscriber is the platform event’s ID.
Packaging
When you package an event process, the associated object isn’t automatically included. Advise your subscribers to create the object or manually add the object to your package. For example, when you package an event process that’s associated with the Participants custom object, manually add the object to your package.
Uninstalling Events
Before you uninstall a package that includes a platform event, deactivate all processes that reference the event.
Compatibility Considerations for Processes
Before you design a process, understand how processes interact with other Salesforce features, like custom objects and fields.
Objects
Process Builder doesn’t support:
•
Deprecated custom objects
•
External objects
•
Signup Request — unsupported in schedules only
•
Social Post
•
Social Persona
Custom Fields
•
Process Builder doesn’t support custom fields of type File.
•
If a process references a custom field:
–
You can’t delete the field.
–
If you change the field type or name, the process breaks.
–
If you change the field label, the process doesn’t break. But it still uses the original label.
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Professional,
Enterprise, Performance,
Unlimited, and Developer
Editions
Shield Platform Encryption
You can’t use an encrypted field as a filter in an Update Records action.
Validation Rules
•
Immediate Update Records actions obey validation rules.
•
Scheduled Update Records actions skip validation rules.
Converted Leads
To evaluate records that result from converted leads, enable the lead setting Require Validation for Converted Leads.
Formula Field Values
If a standard formula field references a field on a related object, that field's value is always null when a process starts. This limitation doesn’t apply to custom formula fields that reference a field on a related object. For a custom formula field that uses the same formula, the field’s value is derived when a process starts.
For example, the RevenueShare field on Campaign Influence calculates
CampaignInfluence.Opportunity.Amount
* CampaignInfluence.Influence
. Because the formula references a field on Opportunity (a related object), the field’s value is null.
366
Extend Salesforce with Clicks, Not Code Lightning Process Builder
Process Formula Limitations
Formulas that are used as conditions in a criteria node have some limitations. If a process contains an invalid formula, you can’t save or activate the process.
All formulas that are used in a criteria node must:
•
Return true
or false
. If the formula returns true
, the associated actions are executed.
•
Not contain more than 3,000 characters.
•
Not contain an unsupported function.
Tip: Parentheses aren’t included automatically when you insert a function. Be sure to add parentheses, for example,
TODAY()
, when building a formula.
You can’t add merge fields from platform events to a formula.
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Professional,
Enterprise, Performance,
Unlimited, and Developer
Editions
Unsupported Functions
If a formula in a process uses any of the following functions, the formula will return null
.
•
GETRECORDIDS
•
IMAGE
•
INCLUDE
•
PARENTGROUPVAL
•
PREVGROUPVAL
•
REQUIRE SCRIPT
•
VLOOKUP
Note:
•
If your process criteria uses a formula, don’t create a formula that always evaluates to true, such as
2 < 5
.
•
ISCHANGED is available as both a formula function and as an operator. When it’s used as a formula function in process criteria, you can’t reference a child record’s related fields. For example, ISCHANGED isn’t supported when referencing a
[Case].Contact.AccountId
field, but it can be used when referencing
[Case].ContactId
.
SEE ALSO:
Tips for Working with Picklist and Multi-Select Picklist Formula Fields
Process Builder Advanced Option Considerations
Tips for Working with Picklist and Multi-Select Picklist Formula Fields
367
Extend Salesforce with Clicks, Not Code Lightning Process Builder
Considerations for Scheduling Process Actions
Scheduled actions are supported only in processes that start when a record changes. The record is processed according to the type of schedule, whether the field changed, and whether the process was deactivated.
EDITIONS
Before you add a schedule to a process, understand the limits and what isn’t supported.
How Does Salesforce Process Scheduled Actions?
Understand the expected behavior for processing scheduled actions based on which type of schedule they’re associated with, whether the field changed, and whether the process was deactivated.
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Professional,
Enterprise, Performance,
Unlimited, and Developer
Editions
Transactions and Scheduled Actions
Immediate actions in processes are executed in the same transaction as the operation that triggered the process—that is, when a user created or edited a record. Scheduled actions are included in a separate transaction.
Process Schedule Limitations
Before you add a schedule to a process, understand the limits and what isn’t supported.
•
Across all versions, your org can have up to 20,000 process schedules based on a field and flow wait events based on relative time alarms.
•
If an action group contains scheduled actions, you can’t continue evaluating the next criteria in your process after executing those actions.
•
SignupRequest processes don’t support scheduled actions.
•
Field-based schedules can’t reference a Date or Date/Time field that contains automatically derived functions, such as TODAY or NOW.
•
Field-based schedules can’t reference a formula field that includes related-object merge fields.
•
If you add a schedule for 0 Days Before a date, when you later reopen the process, the schedule changes to 0 Days After the date. The process still executes at the specified time.
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Professional,
Enterprise, Performance,
Unlimited, and Developer
Editions
How Does Salesforce Process Scheduled Actions?
Understand the expected behavior for processing scheduled actions based on which type of schedule they’re associated with, whether the field changed, and whether the process was deactivated.
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Limits for Processing Scheduled Actions
•
An org can process up to 1,000 groups of scheduled actions per hour.
Each group of scheduled actions is associated with a schedule, such as “3 days from now.” When a schedule is processed, the associated actions are executed. If an org exceeds this limit,
Salesforce processes the remaining schedules in the next hour.
Available in: Professional,
Enterprise, Performance,
Unlimited, and Developer
Editions
For example, an org has 1,200 groups of pending actions scheduled to be processed between
4:00 and 5:00 PM. Salesforce processes 1,000 groups between 4:00 and 5:00 PM, and it processes the remaining 200 groups between
5:00 and 6:00 PM.
•
An org can have up to 30,000 pending schedules and waiting flow interviews at one time.
368
Extend Salesforce with Clicks, Not Code Lightning Process Builder
Schedules Based on the Current Time
For example: 3 days from now.
The schedule is evaluated based on the time zone of the user who created the process.
Schedules Based on a Field Value
For example: 3 days after a case’s
Created Date
.
•
The schedule is evaluated based on the org’s time zone.
•
If the schedule references a null field value, Salesforce ignores that schedule.
•
If actions are scheduled for a time in the past, Salesforce executes that group of scheduled actions within 1 hour.
For example, a process is configured to email an opportunity owner 7 days before the close date. The process runs for an opportunity with the close date set to today, so Salesforce executes the scheduled actions within an hour.
•
If you schedule an action for 0 Days After a date, a delay can occur from the time represented by the date field before the action group executes.
Limitations for Converted Leads
•
You can’t convert a lead when an unexecuted schedule is based on one of the lead’s fields.
•
If Validation and Triggers from Lead Convert is enabled, scheduled actions on leads aren’t executed during lead conversion.
•
If a lead is converted into a campaign member before the associated scheduled actions finish, Salesforce still executes the scheduled actions.
What Happens When the Field Values Change?
•
For processes that start when a record is created or edited, scheduled actions remain in the queue only as long as the criteria for those actions are still valid. If a record no longer matches the criteria, Salesforce removes the scheduled actions for the record from the queue.
•
For processes that start when a record is created, Salesforce never reevaluates the record with that process. Scheduled actions remain in the queue, even if the record no longer meets the associated criteria when the scheduled actions are executed.
•
If you change the referenced field value and the schedule hasn’t been processed, Salesforce recalculates the schedule associated with the field.
For example, a process is configured to email an opportunity owner 7 days before the opportunity close date. The close date is set to 2/20/2014. Salesforce processes the schedule on 2/13/2014 and sends the email. If the close date is later updated to
2/10/2014 and the schedule hasn’t been processed yet, Salesforce recalculates the schedule and sends the email on 2/3/2014.
If Salesforce recalculates the schedule to a date in the past, it executes the associated actions shortly after you save the record.
•
If the record or object that the schedule is associated with is deleted, Salesforce never processes the schedule.
What Happens When the Associated Process Is Deactivated?
After you deactivate a process, the scheduled actions continue as usual. If a deactivated process has pending scheduled actions and the record whose field the schedule is based on is changed, Salesforce recalculates the schedule for those actions.
Once a process is deactivated, Salesforce ignores all other changes to associated records.
What Happens When Scheduled Actions Fail?
If scheduled actions fail—for example, because the user who caused the process to start is inactive—the admin who created the process receives an email with details about the failure. Salesforce makes additional attempts to execute failed scheduled actions before removing them from the queue.
369
Extend Salesforce with Clicks, Not Code Lightning Process Builder
Transactions and Scheduled Actions
Immediate actions in processes are executed in the same transaction as the operation that triggered the process—that is, when a user created or edited a record. Scheduled actions are included in a separate transaction.
EDITIONS
Groups of scheduled actions aren’t performed independently. They’re grouped into a single batch that starts performing within 1 hour after the first group enters the batch. The batch can also include flow interviews that are resumed after a specified time occurs. This behavior can cause you to exceed your Apex governor limits if actions in the group execute DML operations or SOQL queries.
A DML operation is used each time a Salesforce record is created, updated, or deleted, such as when a process executes a Create a Record action. A SOQL query is used each time Salesforce looks up information about an existing record, such as when a process executes an Update Records action.
For details on Apex governor limits, see Process Limits on page 362.
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Professional,
Enterprise, Performance,
Unlimited, and Developer
Editions
If your process contains scheduled actions, make sure that the actions don’t perform more DML operations or SOQL queries than the
Apex governor limits permit.
If a group of scheduled actions fails to be executed:
•
Prior groups of scheduled actions in that batch’s transaction are successful.
•
The immediate actions for that process are successful.
•
All scheduled actions in that group aren’t executed.
•
The remaining groups of scheduled actions in that batch are tried.
Example:
Salesforce is going to process a batch of 25 groups of scheduled actions in the same transaction. Up to 100 DML operations can be used across this batch. The first 22 groups each use five DML operations, and the remaining three groups don’t use any DML operations.
The 21st group violates the Apex governor limits by trying to execute the 101st through 105th DML operations for this transaction.
The first 20 groups of scheduled actions are successfully executed, but the 21st group of scheduled actions fails. None of its actions are successful, no matter which action in the group violated the limit. Salesforce then tries to execute the remaining groups of scheduled actions in the batch. Because the 22nd group uses five DML operations and the transaction has already used all its allowed DML operations, the 22nd group also fails. Because the last three groups don’t use DML operations, those groups are successfully executed.
Considerations for Processes That Post to Chatter
The Post to Chatter action doesn’t support communities, and there are some limitations around what you put in the message.
Unsupported Feeds
Processes can’t post to a Community user or group.
Chatter Message
•
You can add up to 25 @mentions to a Chatter message.
•
If you use Microsoft
®
Internet Explorer
®
version 11, you can’t paste text into a message. Copy and paste actions are allowed in all other supported browsers.
•
Don’t start the message with a field reference, such as
{![Account].Name}
. Otherwise, the action fails to save. To work around this issue, add a space at the beginning of the message.
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Professional,
Enterprise, Performance,
Unlimited, and Developer
Editions
370
Extend Salesforce with Clicks, Not Code Lightning Process Builder
Deploying Processes That Post to Chatter
If your process posts to the Chatter feed of a specific user or group, the process runs only in the source org. The IDs referenced by the Post to Chatter action don’t exist in the target org.
Considerations for Processes That Update Records
Understand what happens when you change a record owner, update the same field multiple times, or update currency fields in a multiple currency org.
Updating a Record’s Owner
Processes that update owners don’t automatically transfer the associated items. Use an Update
Records action for each type of child record that you want to transfer.
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
For example, you want to transfer an account to a new owner. Add four Update Records actions to your process. The first updates the account. The second updates the child contacts. The third updates the child opportunities. And the fourth updates the child contracts.
Multiple Updates to the Same Field
If multiple Update Records actions apply different values to the same field, the last action’s value is used.
Available in: Professional,
Enterprise, Performance,
Unlimited, and Developer
Editions
Multiple Currencies
If your org uses multiple currencies, the currency fields are updated using the record’s currency code. If you use a formula to update a field, the formula values use the record’s currency code.
Considerations for Managing Processes
Understand what happens when you install, activate, or delete processes.
Installed Processes
If you installed a process from a managed package, you can only activate it or deactivate it. You can’t view or edit the process.
Active Processes
After you activate a process, you can no longer edit it.
Deleting Processes
You can’t delete a process when it has unexecuted groups of scheduled actions. The workaround is to
delete the unexecuted groups of unscheduled actions on page 403.
Considerations for Deploying Processes
Keep these considerations in mind when deploying processes, such as when using packages or change sets.
Processes That Reference Other Components
If you deploy a process that contains any of the following actions, the corresponding components aren’t included in the package or change set automatically. To deploy successfully, manually add the referenced components to the package or change set.
•
Apex
•
Email Alerts
•
Launch a Flow
•
Post to Chatter
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Professional,
Enterprise, Performance,
Unlimited, and Developer
Editions
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Professional,
Enterprise, Performance,
Unlimited, and Developer
Editions
371
Extend Salesforce with Clicks, Not Code Lightning Process Builder
•
Quick Actions
•
Submit for Approval
Metadata API
•
If the process already exists in the target org, it must be inactive. Otherwise, the process fails to deploy.
•
If the process doesn’t exist in the target org, it deploys with an inactive status, regardless of its status in the source org.
Deploying Processes That Post to Chatter
If your process posts to the Chatter feed of a specific user or group, the process runs only in the source org. The IDs referenced by the Post to Chatter action don’t exist in the target org.
Setting Values in the Process Builder
Throughout the Process Builder, you need to set values, for example, to set conditions in a criteria node, to set the fields on a new case in a Create a Record action, or to specify an Apex method to reference.
Use the field picker to reference fields on the record that started the process or fields on related records.
When setting a value for a given field—whether on the record that started the process or a related record— the available value types are filtered based on the field that you’ve selected.
Multi-Select Picklists in the Process Builder
The Process Builder lets you select multiple values for a multi-select picklist field.
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Professional,
Enterprise, Performance,
Unlimited, and Developer
Editions
Field Picker
Use the field picker to reference fields on the record that started the process or fields on related records.
To use fields on a related record, click a field with next to the value. For example, use the Account
ID field value on the case’s contact’s account.
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Professional,
Enterprise, Performance,
Unlimited, and Developer
Editions
The field picker displays only fields that are compatible with the selected parameter.
372
Extend Salesforce with Clicks, Not Code Lightning Process Builder
If you see a field multiple times, that means the field can relate to multiple objects. For example, if you created a queue for cases, a case’s owner can be either a user or a queue.
Owner ID
is a polymorphic field—a field that relates to more than one object.
To access a field on the case’s owner, choose the appropriate relationship. Be careful, though. If you pick Owner ID (User) and the owner of the record is actually a queue, the process fails.
Process Builder Value Types
When setting a value for a given field—whether on the record that started the process or a related record— the available value types are filtered based on the field that you’ve selected.
The available value types are:
•
Currency—Manually enter a currency value.
•
Boolean—Choose a true/false boolean value.
•
Date/Time or Date—Manually enter a date/time or date value.
•
Formula—Create a formula expression.
•
Global Constant—Choose a global constant to set a value to null or an empty string—for example, choose $GlobalConstant.Null.
Note: These global constant values aren’t supported with the is null
operator.
–
$GlobalConstant.Null
–
$GlobalConstant.EmptyString
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Professional,
Enterprise, Performance,
Unlimited, and Developer
Editions
•
ID—Manually enter a Salesforce ID value, for example,
00300000003T2PGAA0
.
Note: If your process is based on a user ID (for example, when an [Event].OwnerId equals a specific ID value) make sure that the ID value is an 18-character ID and not a 15-character ID. You can convert a 15-character ID to 18 characters at www.adminbooster.com/tool/15to18 .
•
Multi-Picklist—Choose one or more multi-select picklist values.
•
Number—Manually enter a number value.
•
Picklist—Choose a picklist value.
•
Queue—Search for a specific queue in your org.
•
Reference—Choose a field on the record or on a related record.
•
String—Manually enter a string value.
•
User—Search for a specific user in your org.
373
Extend Salesforce with Clicks, Not Code Lightning Process Builder
Multi-Select Picklists in the Process Builder
The Process Builder lets you select multiple values for a multi-select picklist field.
EDITIONS
For example, set multiple values for the
Country
field for a company record that operates in
Ireland, the UK, and France.
You can use multi-select picklists in:
•
Formulas
•
Process criteria
•
Create a Record actions
•
Quick Actions
•
Update Records actions
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Professional,
Enterprise, Performance,
Unlimited, and Developer
Editions
In process criteria, set multiple values by creating one condition for each individual multi-select picklist value. For example, if your process checks whether changes were made to an account’s office locations, reference multiple values by choosing the same field for each multi-select picklist value.
Refer to
Tips for Working with Picklist and Multi-Select Picklist Formula Fields for more information.
When you reference a multi-select picklist field in an action, enter values by clicking Choose values…
Add or remove values by dragging them between the Available (1) and Selected (2) columns.
374
Extend Salesforce with Clicks, Not Code Lightning Process Builder
Keep these considerations in mind when using operators with multi-select picklists.
•
You can use the Equals operator if you select only one value from a multi-select picklist field.
•
If you use the Equals operator with multiple multi-select picklist values and choose the Any of the conditions are met (OR) option, the condition matches on one value only. For example, if your process checks whether a Region field equals West or East, the condition evaluates to true when the value is West or when the value is East, but won’t evaluate to true when both West and East are selected values.
•
If you use Contains and OR to evaluate multiple multi-select picklist values, the condition evaluates to true on multiple values. For example, if your process checks whether a
Region
field contains West or East, the condition evaluates to true when a
Region field contains West and East or when a
Region
field contains West or East values.
Setting Advanced Options in the Process Builder
The Process Builder lets you choose some advanced options for executing actions in your processes.
EDITIONS
Process Builder Advanced Option Considerations
Keep these considerations in mind when choosing advanced options.
Available in: both Salesforce
Classic and Lightning
Experience
Reevaluate Records in the Process Builder
When you add objects to your process, you can choose to evaluate a record multiple times in a single transaction.
Nest Processes in the Process Builder
Invocable processes let you modularize sections of your processes and add more logic to them.
An invocable process is process that starts when another process invokes it. Whether a process is invocable or not is controlled by
The process starts when
in the process’s properties.
Available in: Professional,
Enterprise, Performance,
Unlimited, and Developer
Editions
375
Extend Salesforce with Clicks, Not Code Lightning Process Builder
Avoid Unwanted Actions in Processes
When you add criteria to your process, you can choose to execute actions only when specified criteria changes.
Process Builder Advanced Option Considerations
Keep these considerations in mind when choosing advanced options.
•
Avoid creating an infinite loop when allowing your process to reevaluate records. For example, if your process checks whether an account description changes and then updates an account description and creates a Chatter post every time an account record is created or edited, the process will evaluate and trigger actions resulting in six Chatter posts.
•
If you choose to evaluate a record multiple times in a single transaction when you specify an object for your process, we recommend not setting any of your criteria to No criteria—just execute the actions!.
•
We recommend that you don’t use the advanced options if your process uses ISCHANGED,
ISNEW, or PRIORVALUE formula functions. If you do use these options, keep these considerations in mind.
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Professional,
Enterprise, Performance,
Unlimited, and Developer
Editions
–
When a record is first created, ISNEW evaluates to true throughout a process transaction. If your process uses the ISNEW formula function and reevaluates a record multiple times in a single transaction, the process may execute actions multiple times.
For example, your process checks whether an account is created or updated.
1. When ISNEW evaluates to true, the process updates the account’s annual revenue and posts to Chatter.
2. When the process updates the account’s annual revenue, the process then reevaluates the record (up to five additional times) because the record was changed.
Each time the criteria is evaluated, ISNEW evaluates to true. The result is six Chatter posts. This example is true only if the process is triggered because an account record is created.
–
When a record is created, PRIORVALUE returns the current value as the prior value. When a record is updated, PRIORVALUE returns the field value that was set immediately before the transaction started. If your process uses the PRIORVALUE formula function and reevaluates a record multiple times in a single transaction, the process may execute actions multiple times. If your process reevaluates a record multiple times in a single transaction and executes actions only when specified criteria changes, the prior value returns the values that existed before the record was saved.
For example, your process checks whether an account is created or updated.
1. When
PRIORVALUE([Account].Type) = 'Prospect'
evaluates to true, the process updates the account’s annual revenue and posts to Chatter.
2. When an account is created with
Prospect
as the account type, the criteria is always true until the end of the process transaction.
3. If the process is changed to update the account type to
Other
when the criteria is true, then for an account created with
Prospect
as the account type, the formula
PRIORVALUE([Account].Type) = 'Prospect'
will be true until the end of process transaction.
Each time the record is reevaluated, the prior value of the account’s type is Prospect. The result is six Chatter posts.
–
ISCHANGED always evaluates to false when a record is first created.
For example, your process checks whether an account description changes—
ISCHANGED([Account].Description)
—and the process also reevaluates records multiple times in a single transaction. If an account is first created with a blank description value and another process updates the account description
376
Extend Salesforce with Clicks, Not Code Lightning Process Builder in the same transaction, ISCHANGED evaluates to true every time the record is reevaluated because it compares the account description value when the record was first created (a blank value) with whatever’s set for the current value.
Let’s say this same process creates a Chatter post every time ISCHANGED([Account].Description) evaluates to true. This process would create a recursive loop resulting in six Chatter posts because ISCHANGED evaluates to true throughout the transaction.
Reevaluate Records in the Process Builder
When you add objects to your process, you can choose to evaluate a record multiple times in a single transaction.
It's kind of like using a roundabout instead of a four-way stop to control process traffic. Instead of stopping and waiting for separate transactions, reevaluating records helps your business traffic flow a little more freely.
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
If you choose this option, the process can evaluate the same record up to five additional times in a single transaction. It might reevaluate the record because a process, workflow rule, or flow updated the record in the same transaction. When a record is reevaluated, the process uses the most recent values for that record.
Available in: Professional,
Enterprise, Performance,
Unlimited, and Developer
Editions
For example, your sales review process includes multiple steps, approvals, notifications, and fields that need to be updated. Some of these changes may be part of your process, or they may be managed by other workflow rules or flows in your organization. If you allow the Process Builder to reevaluate a record multiple times in a single transaction, you can manage and evaluate all of these changes—even changes from other processes—in a single transaction in your process.
SEE ALSO:
Process Builder Advanced Option Considerations
Nest Processes in the Process Builder
Invocable processes let you modularize sections of your processes and add more logic to them. An
invocable process is process that starts when another process invokes it. Whether a process is invocable or not is controlled by
The process starts when
in the process’s properties.
To invoke a process from another process, you configure a Processes action. That configuration includes passing a record to the invocable process. That’s how the process knows which record to start with. Because the record is passed from one process to another, the invocable process receives a certain version of that record. That version differs, depending on when the Processes action is executed.
Immediate Action
When you invoke a process through an immediate action, the process receives the values that the record contained when the top-level process starts.
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Professional,
Enterprise, Performance,
Unlimited, and Developer
Editions
Example: Process 1 updates an account and then invokes Process 2 based on that account. Process 2 receives the version of the account when Process 1 started.
Scheduled Action
When you invoke a process through a scheduled action, the process receives the latest values for the record.
Example: Process 1 updates an account and, 15 minutes later, invokes Process 2 based on that account. Process 2 receives the latest version of the account from the database.
377
Extend Salesforce with Clicks, Not Code Lightning Process Builder
When Should I Build an Invocable Process?
Do you find yourself building the exact same actions for multiple action groups? Configure those actions one time in an invocable process, and then invoke that process from all the relevant action groups. Later, to update those actions, update the one invocable process. All the other processes then use the updated actions.
Another cool scenario for invocable processes: nesting simple logic. Processes handle simple “if/then” statements. But what if you need to nest some of those statements? Rather than having to build a flow or write code, build the second level of logic into another process.
Invoke the second process from the first, and voila!
Example:
Let’s say you handle all of your case management in a single process. But you need to treat escalated cases for high-revenue accounts differently from escalated cases for regular accounts. If the case is escalated by an account whose renewal date is less than a month away, notify the account owner, the regional manager, and the VP of that region. If the case is escalated by an account whose renewal date is more than a month away, notify only the account owner and the regional manager.
To do so, you build an invocable process. Let’s call it “Escalated Cases.” The process operates on the Case object and has two criteria nodes.
•
The first criteria node evaluates whether the associated account’s renewal date is less than a month away. When a case meets that criteria, the process posts to the account’s feed with a link to the case and mentions the account owner, regional manager, and regional VP.
•
The second criteria node has no criteria. If a case doesn’t meet the first node’s criteria, the process performs the same action, except that it doesn’t mention the regional VP.
Now back to the process that automates your case management. You already have a criteria node that checks whether the case is escalated. Add a Processes action to that criteria’s action group, and configure the action to invoke the “Escalated Cases” process.
Avoid Unwanted Actions in Processes
When you add criteria to your process, you can choose to execute actions only when specified criteria changes.
EDITIONS
For example, your process sends an email alert whenever a case has an Escalated status. Let’s say your support team repeatedly updates the case description with new information. Whenever the case is saved with a new description, you process can check specifically whether the Escalated status changed instead of just repeatedly sending email alerts. This way, the process executes actions only if the status wasn’t set to Escalated and was just changed to Escalated.
Available in: both Salesforce
Classic and Lightning
Experience
Tip: Check out this short video Avoid Unwanted Actions in Your Process to learn more about this option.
This setting isn’t supported if:
Available in: Professional,
Enterprise, Performance,
Unlimited, and Developer
Editions
•
Your process starts only when a record is created.
•
Your process starts when a record is created or edited and the criteria node doesn’t evaluate any criteria.
•
The criteria node evaluates a formula, but the formula doesn’t include a reference to the record that started the process.
•
Your process uses the Is changed operator in a filter condition.
If Yes is...
Selected
Actions are executed if...
Actions are not executed if...
•
The record was created.
•
The record was updated. Its current values meet the conditions, and its most recent previous values did not meet the conditions.
•
The record’s current values meet the conditions, and the record’s most recent previous values met the criteria.
•
The record’s current values don’t meet the conditions.
378
Extend Salesforce with Clicks, Not Code Lightning Process Builder
If Yes is...
Deselected
Actions are executed if...
•
The record was created.
•
The record was updated, and its current values meet the conditions.
Actions are not executed if...
The record’s current values don’t meet the conditions.
SEE ALSO:
Process Builder Advanced Option Considerations
Create a Process
To create a process, define its properties and which records it should evaluate, and then add criteria nodes and actions.
1.
The process properties uniquely identify your process.
2.
Every process includes a trigger, which tells the process when to start. How you configure that trigger depends on what type of process you’re creating.
3.
Define the criteria that must be true before the process can execute the associated actions.
4.
After you define a criteria node, define the actions that are executed when the criteria are met.
Actions are executed in the order in which they appear in the Process Builder.
5.
Execute Actions on More Than One Criteria
Choose whether to stop or continue your process after specific criteria are met and associated actions execute.
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Professional,
Enterprise, Performance,
Unlimited, and Developer
Editions
USER PERMISSIONS
To create, edit, or view processes:
•
Manage Force.com Flow
AND
View All Data
379
Extend Salesforce with Clicks, Not Code Lightning Process Builder
Define the Process Properties
The process properties uniquely identify your process.
1. From Setup, enter
Builder
in the Quick Find box, and select Process Builder.
2. Click New.
3. Define your process by completing the fields.
Field
Process
Name
Description
The name for your process, up to 255 characters.
This name appears in the process management page, so name your process so that you can differentiate it from other processes. To see the page, from
Setup, enter
Builder
in the Quick Find box, then select Process Builder.
API Name
The name that the API and managed packages use, up to 79 characters.
This name must be unique across all processes and flows. In flows, this field is
Unique Name
. The name must begin with a letter and use only alphanumeric characters and underscores. It can’t include spaces, end with an underscore, or have two consecutive underscores.
Important: After it’s saved, you can’t change the process’s API name.
Description
Optional. A description for your process.
The description also appears in the process management page. It’s intended to help you differentiate between processes, such as to explain what a process does.
The process starts when
Identifies when the process begins. You can set your process to start when:
•
A record changes
•
A platform event occurs
•
It’s invoked by another process
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Professional,
Enterprise, Performance,
Unlimited, and Developer
Editions
USER PERMISSIONS
To create, edit, or view processes:
•
Manage Force.com Flow
AND
View All Data
4. Click Save.
380
Extend Salesforce with Clicks, Not Code Lightning Process Builder
Configure the Process Trigger
Every process includes a trigger, which tells the process when to start. How you configure that trigger depends on what type of process you’re creating.
If the process starts when a record changes, associate the process with an object, and specify when to start the process.
If the process starts when a platform event occurs, associate the process with a platform event and an object, and specify matching conditions. Because every process acts on a Salesforce record, it requires a single record as a starting point. That way, the criteria and actions know where to start evaluating and executing.
If the process starts when another process invokes it, associate the process with an object.
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Professional,
Enterprise, Performance,
Unlimited, and Developer
Editions
Event processes are available in: Enterprise,
Performance, Unlimited, and Developer Editions
Record Change
If the process starts when a record changes, associate the process with an object, and specify when to start the process.
1. Click Add Object.
2. Configure the trigger.
For this field
...
Select ...
Object The object that you want to base this process on. Click Find an object. Type to filter the dropdown list.
Start the process
Which type of record change triggers the process.
•
only when a record is created
•
when a record is created or edited
Note: If you’re familiar with workflow rules and you’re wondering what happened to the third option (created, and any time it’s edited to subsequently meet criteria), don’t worry! You see that setting when you add criteria nodes if you selected when a record is created or
edited.
Recursion -
Allow process to evaluate a record multiple times in a single transaction?
Yes, if you want the process to evaluate a record multiple times in a single transaction. To see this field, expand the Advanced area.
When enabled, the process can evaluate the same record up to five more times in a single transaction. It might reevaluate the record because a process, workflow rule, or flow updated the record in the same transaction. For more information, see
Reevaluate Records in the Process Builder
on page 377.
USER PERMISSIONS
To create, edit, or view processes:
•
Manage Force.com Flow
AND
View All Data
381
Extend Salesforce with Clicks, Not Code Lightning Process Builder
3. Before saving your changes, confirm the selection because you can’t change the object after you save it.
Event
If the process starts when a platform event occurs, associate the process with a platform event and an object, and specify matching conditions. Because every process acts on a Salesforce record, it requires a single record as a starting point. That way, the criteria and actions know where to start evaluating and executing.
1. Click Add Trigger.
2. Configure the trigger.
For this field ...
Platform Event
Select...
The platform event that you defined.
Object The object whose records you want to associate with the event.
Matching Conditions Criteria to identify one record to associate the event with. We recommend using an ID or other field that uniquely identifies records so the process can pick exactly one record.
The process fails if it finds:
•
Multiple records that match the criteria.
•
No records that match the criteria.
3. Before saving your changes, confirm the selection because you can’t change the platform event or object after you save it.
Invocable
If the process starts when another process invokes it, associate the process with an object.
1. Click Add Object.
2. Select an object to associate with the process. Type to filter the dropdown list.
382
Extend Salesforce with Clicks, Not Code Lightning Process Builder
This process can be invoked from any other process as long as the master process passes a record of this object type. For example, an Account-based invocable process can be called from a Contact-based record change process, because you can pass the contact’s account to the invocable process.
3. Before saving your changes, confirm the selection because you can’t change the object after you save it.
Add Process Criteria
Define the criteria that must be true before the process can execute the associated actions.
When criteria are met, the process executes the associated action group. When criteria aren’t met, the process skips the action group and evaluates the criteria for the next action group.
1. Click Add Criteria.
2. Enter a name for this criteria node.
The name appears on the canvas, so use a name that helps you differentiate between other criteria nodes.
3. Select the type of criteria that you need to define. This selection determines which fields appear later in the dialog box.
If you need...
The record to have certain field values.
For example, to execute the associated actions on opportunity records with an amount greater than $5,000, set the filter to:
[Opportunity].Amount greater than $5000.00
Select
Conditions are met
To evaluate the record by using a formula.
For example, to execute the associated actions on accounts whose annual revenue is over $1,000,000 when the account is changed by someone other than the owner, use this formula.
Formula evaluates to true
AND (([Account].LastModifiedBy.Id <>
[Account].Owner.Id) , ([Account].AnnualRevenue
> 1000000) )
To simply execute the associated actions without evaluating the record.
The process executes all the actions that are associated with this criteria node and, unless you specify otherwise, doesn’t evaluate any remaining criteria nodes in the process. If you choose to stop your process after executing these actions, we recommend choosing this option for only the last criteria node in your process.
No criteria—just execute the actions!
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Professional,
Enterprise, Performance,
Unlimited, and Developer
Editions
USER PERMISSIONS
To create, edit, or view processes:
•
Manage Force.com Flow
AND
View All Data
4. If you selected “Conditions are met”:
a. Define the filter conditions by identifying the field values that the process needs to evaluate.
383
Extend Salesforce with Clicks, Not Code Lightning Process Builder
Field
Select the field whose value you want to evaluate. You can also evaluate values for records that are related to the one that started the process. To do so, click on a related record with next to the ID field.
For example, if a contact record started the process, you can evaluate the value for the contact’s account’s
Annual Revenue
field. To access that field, click
Account Id
, select Annual Revenue, and then click Choose.
Operator
The available operators depend on the field’s data type.
Type
The available value types depend on the field’ data type.
Value
on page 372 for details.
b. For
Conditions
, identify which conditions must be true for the process to execute the associated actions.
If you choose to use custom logic, enter a text string using:
•
Numbers to refer to each condition
•
AND or OR to identify whether all or just one of the conditions must true
•
Parentheses to group parts of the string together
For example, if you enter 1 AND (2 OR 3), the outcome evaluates to true if the first condition is true and either the second or third outcome is true. The maximum length of the condition logic text is 1000 characters as per Flow restrictions.
Note:
Ambiguous logic separated by a parenthesiss may not cause a validation error. For example:
•
1 AND 2 OR 3 results in an error
•
1 AND (2 AND 3) OR 4 doesn't result in an error
Avoid creating ambiguous custom logic when grouping parts of a string or you may see unexpected results.
5. If you selected “Formula evaluates to true,” define the formula.
6. Optionally, to specify whether you want to execute the actions only if the record was created or edited to meet criteria, click Advanced at the bottom of the panel.
For details, see
Avoid Unwanted Actions in Processes on page 378.
Note:
This setting is available only if the process starts when a record is created or edited and you selected “Filter conditions are met” or “Formula evaluates to true.”
7. Click Save.
SEE ALSO:
Execute Actions on More Than One Criteria
384
Extend Salesforce with Clicks, Not Code Lightning Process Builder
Add Actions to Your Process
After you define a criteria node, define the actions that are executed when the criteria are met.
Actions are executed in the order in which they appear in the Process Builder.
An action group can consist of a combination of immediate and scheduled actions. Immediate actions are executed when evaluation criteria are met. Scheduled actions are executed at a specified time. For example, Salesforce can automatically send an email reminder to the account team if a high-value opportunity is still open 10 days before the specified close date.
Before you begin, consider whether you want this action to be executed immediately or at a specific
1. Click Add Action.
2. Select the type of action to create, and then fill out the fields to define the action.
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Professional,
Enterprise, Performance,
Unlimited, and Developer
Editions
USER PERMISSIONS
Create a Record from a Process
Create a record by manually entering values or by using the values of related records.
Invoke a Process from Another Process
Invoke a process from another process. With invocable processes, you have the option of reuse so that you don’t spend your time on repetitive work.
To create, edit, or view processes:
•
Manage Force.com Flow
AND
View All Data
Create a Chatter Post from a Process
Post to the feed of a user, a Chatter group, or the record that started the process.
Use a Quick Action from a Process
Create a record, update a record, or log a call by using a quick action that you or another admin created for your organization.
Start an autolaunched flow from your process to automate complex business processes—create flows to perform logic and have events trigger the flows via processes—without writing code.
Easily send an email from a process by using an email alert. Email alerts are configured outside of the Process Builder and contain the standard text, list of recipients, and template for an email.
Submit a Record for Approval from a Process
Submit the record that started the process for approval.
Update one or more records that are related to the record that started the process by manually entering values or by using the values from related records.
Add customized functionality to your process by calling Apex from the process.
385
Extend Salesforce with Clicks, Not Code Lightning Process Builder
Specify When Your Actions Should Execute with a Schedule
You can schedule actions to execute at a specific time. An action group that supports scheduled actions can have multiple schedules. For example, you can schedule some actions to execute one day from now and others to execute three days from now.
Note:
Before adding scheduled actions to your process, understand how they work. Review
Scheduled Actions Considerations .
Scheduled actions aren’t supported in all action groups. If you want to schedule actions, make sure that one of the following options is true for your action group.
•
The process starts only when a record is created (1).
•
The process starts when a record is created or edited (2), and the associated criteria node executes actions only when specified changes are made (3).
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Professional,
Enterprise, Performance,
Unlimited, and Developer
Editions
USER PERMISSIONS
To create, edit, or view processes:
•
Manage Force.com Flow
AND
View All Data
1. In an action group that supports scheduled actions, click Set Schedule.
2. If you need to schedule actions based on a date/time field on the record that started the process:
a. Leave the first radio button selected.
b. From the dropdown list on the right side of the panel, select the date to schedule the action.
For example, if your process is based on an account record, choose the account’s Created Date.
c. Specify the number of days or hours before or after the field.
If the criteria for this action group are still met when this time occurs, Salesforce executes the scheduled actions.
3. If you need to schedule actions after a certain number of days or hours from when the process is executed:
386
Extend Salesforce with Clicks, Not Code Lightning Process Builder
a. Select the second radio button.
b. Specify the number of days or hours from when the process is executed.
If the criteria for this action group are still met when this time occurs, Salesforce executes the scheduled actions.
4. Save the schedule.
Create a Record from a Process
Create a record by manually entering values or by using the values of related records.
After you create an action and select “Create a Record” for the type, fill in the relevant fields to add the action to your process. The new record’s
Created By
field is then set to the user who started the process by creating or editing a record.
Warning: If you create processes to replace any workflow rules, ensure that you delete those workflow rules when you activate the equivalent processes. Otherwise, both workflow rules and processes fire and cause unexpected results, such as overwritten records or redundant email messages. Do the same if you create processes to replace any Apex triggers.
1. Enter a name for this action.
This text appears on the canvas and helps you differentiate this action from others in your process. The name truncates to fit on the canvas.
2. For
Record Type
, select the object that you want to create a record for. To filter the drop-down list, type the name of the object to filter the drop-down list.
When you select an object, at least one row appears to allow you to set field values for the new record.
Warning:
Rows appear automatically for fields required by the API. You might need to provide values for other fields. We recommend that you refer to your organization's page layouts to determine which fields are required.
3. Set the record’s field values.
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Professional,
Enterprise, Performance,
Unlimited, and Developer
Editions
USER PERMISSIONS
To create, edit, or view processes:
•
Manage Force.com Flow
AND
View All Data
Field
Type
Value
Select the field whose value you want to set. To filter the drop-down list, type the name of the field.
Select the type of value that you want to use. The available types depend on the field that you’ve selected.
Set a value for the field. by using the text entry field to manually enter a value or the field picker to use a field value
from a related record. See Setting Values in the Process Builder
on page 372 for details.
4. Click Save.
Tip:
•
If you set up your process to create an account record,
Name
appears as a required field. If you want to create a person account, you can add
LastName
as a field but it doesn’t appear as required by default. You can enter a dummy value for the
Name
field.
•
When you create a record, required fields normally appear at the top of the list. However, if you save a Create a Record action, close the process, and then reopen the action, required fields may not appear in the normal order.
387
Extend Salesforce with Clicks, Not Code Lightning Process Builder
Invoke a Process from Another Process
Invoke a process from another process. With invocable processes, you have the option of reuse so that you don’t spend your time on repetitive work.
After you create an action and select “Processes” for the type, fill in the relevant fields to add the action to your process.
You can invoke processes with objects that share at least one unique ID. For example, in the Account and Case objects, the
AccountId
field is unique to Account and also used by Case. You can create an invocable process that updates a Case record. Then you can invoke it from:
•
A process that updates an Account record’s owner
•
A process that adds an Account shipping address or updates it
When you create a process that invokes another process, each one counts toward your process and other applicable limits. DML limits in processes that invoke processes count as one transaction.
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Professional,
Enterprise, Performance,
Unlimited, and Developer
Editions
USER PERMISSIONS
Warning: If you create processes to replace any workflow rules, delete those workflow rules when you activate the equivalent processes. Otherwise, both workflow rules and processes fire and cause unexpected results, such as overwritten records or redundant email messages.
Do the same if you create processes to replace any Apex triggers.
1. Enter a name for this action.
This text appears on the canvas and helps you differentiate this action from others in your process. The name truncates to fit on the canvas.
To create, edit, or view processes:
•
Manage Force.com Flow
AND
View All Data
2. Select an invocable process. You can only select active invocable processes.
3. Select your process variable. Remember that you can only select fields related to the object associated with the process you invoke.
Create a Chatter Post from a Process
Post to the feed of a user, a Chatter group, or the record that started the process.
This action is available only if your organization has Chatter enabled. The feed item will appear as if the user who started the process—by creating or editing a record—created the post.
Post to a User’s Chatter Feed from a Process
Post to the feed of a user by identifying a specific user in your organization or a User lookup field on a record.
Post to a Chatter Group from a Process
Post to the feed of a specific Chatter group.
Post to a Record’s Chatter Feed from a Process
Post to the feed of the record that started the process.
Mention a User or Group in a “Post to Chatter” Process Action
When you post to a Chatter feed from a process, you can mention users if you can reference the corresponding User ID field from the field picker.
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Professional,
Enterprise, Performance,
Unlimited, and Developer
Editions
USER PERMISSIONS
To create, edit, or view processes:
•
Manage Force.com Flow
AND
View All Data
SEE ALSO:
Considerations for Processes That Post to Chatter
388
Extend Salesforce with Clicks, Not Code Lightning Process Builder
Post to a User’s Chatter Feed from a Process
Post to the feed of a user by identifying a specific user in your organization or a User lookup field on a record.
After you’ve created an action and selected “Post to Chatter” for the action type, fill in the relevant fields to add the action to your process.
Warning:
If the feed that the process tries to post to isn't available when the process is triggered (for example, because the user is now inactive), the user sees an error and the process fails.
1. Enter a name for this action.
This text appears on the canvas and helps you differentiate this action from others in your process. The name truncates to fit on the canvas.
2. In the
Post to
field, select User.
3. For
User
, select where you want to find the user.
4. Based on your selection for
User
, search for or browse for the user whose feed you want to post to.
When you select a user from a record, you must ultimately select a field that contains a user’s
ID—for example,
Owner ID
or
User ID
.
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Professional,
Enterprise, Performance,
Unlimited, and Developer
Editions
USER PERMISSIONS
To create, edit, or view processes:
•
Manage Force.com Flow
AND
View All Data
5. Fill out the message that you want to post. You can insert merge fields, add a topic, and mention users or groups.
The message can contain up to 10,000 characters.
You can only reference topics that already exist. If you reference a merge field and that field doesn’t have a value, it appears as a blank value.
6. Save the action.
Post to a Chatter Group from a Process
Post to the feed of a specific Chatter group.
After you’ve created an action and selected “Post to Chatter” for the action type, fill in the relevant fields to add the action to your process.
Warning:
If the feed that the process tries to post to isn't available when the process is triggered, the user sees an error and the process fails.
1. Enter a name for this action.
This text appears on the canvas and helps you differentiate this action from others in your process. The name truncates to fit on the canvas.
2. In the
Post to
field, select Chatter Group.
3. For
Group
, search for the Chatter group whose feed you want to post to.
4. Fill out the message that you want to post. You can insert merge fields, add a topic, and mention users or groups.
The message can contain up to 10,000 characters.
You can only reference topics that already exist. If you reference a merge field and that field doesn’t have a value, it appears as a blank value.
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Professional,
Enterprise, Performance,
Unlimited, and Developer
Editions
USER PERMISSIONS
To create, edit, or view processes:
•
Manage Force.com Flow
AND
View All Data
389
Extend Salesforce with Clicks, Not Code Lightning Process Builder
5. Save the action.
Post to a Record’s Chatter Feed from a Process
Post to the feed of the record that started the process.
You can post to the record’s Chatter feed only if feed tracking is enabled for the object that the process is associated with.
After you’ve created an action and selected “Post to Chatter” for the action type, fill in the relevant fields to add the action to your process.
Warning:
If the feed that the process tries to post to isn't available when the process is triggered (for example, because the user is now inactive), the user sees an error and the process fails.
1. Enter a name for this action.
This text appears on the canvas and helps you differentiate this action from others in your process. The name truncates to fit on the canvas.
2. In the
Post to
field, select This Record.
3. Fill out the message that you want to post. You can insert merge fields, add a topic, and mention users or groups.
The message can contain up to 10,000 characters.
You can only reference topics that already exist. If you reference a merge field and that field doesn’t have a value, it appears as a blank value.
4. Save the action.
Mention a User or Group in a “Post to Chatter” Process Action
When you post to a Chatter feed from a process, you can mention users if you can reference the corresponding User ID field from the field picker.
When you’re configuring the Post to Chatter action:
1. In the Message field, enter
@[]
.
2. Place your cursor between the square brackets.
3. Click Merge Field, navigate to the user who you want to mention, select the corresponding
ID field, and click Choose.
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Professional,
Enterprise, Performance,
Unlimited, and Developer
Editions
USER PERMISSIONS
To create, edit, or view processes:
•
Manage Force.com Flow
AND
View All Data
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Professional,
Enterprise, Performance,
Unlimited, and Developer
Editions
USER PERMISSIONS
To create, edit, or view processes:
•
Manage Force.com Flow
AND
View All Data
390
Extend Salesforce with Clicks, Not Code Lightning Process Builder
The field reference appears between the square brackets.
@[
{!fieldReference}
]
4. Save the action.
Example: To @mention a case’s account owner, navigate to the account’s fields and select Owner ID. Insert that field reference between the square brackets in
@[]
, so that the result is:
@[{![Case].Account.OwnerId}]
Use a Quick Action from a Process
Create a record, update a record, or log a call by using a quick action that you or another admin created for your organization.
Quick actions can be object-specific or global actions. Only Create, Update, and Log a Call actions are supported. To use a quick action from a process, the action must exist in your organization.
If your organization is using quick actions to help your users more easily create and update records, you can also use those actions in your process. When you use these quick actions in a process, you can only set values for fields that are part of the action's layout. If you don’t already have one of these actions created, see
on page 913 or Create Object-Specific Quick
on page 915 for details.
After you’ve created an action and selected “Quick Actions” for the type, fill in the relevant fields to add the action to your process. The new or updated record will appear as if the user who started the process—by creating or editing a record—created or updated it.
1. Enter a name for this action.
This text appears on the canvas and helps you differentiate this action from others in your process. The name truncates to fit on the canvas.
2. Filter to specify the kind of action you want to use.
Filter
Search By
Lets You Search Through
Global actions All global actions in your organization. You then filter even further by selecting the Type of actions that you need to search through.
Object All object-specific actions in your organization that are associated with a certain
Object Name
. Global actions can’t be filtered by object.
Type All object-specific and global actions in your organization based on the type, such as Create a Record or Log a Call.
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Professional,
Enterprise, Performance,
Unlimited, and Developer
Editions
USER PERMISSIONS
To create, edit, or view processes:
•
Manage Force.com Flow
AND
View All Data
•
If you selected Global actions or Type, for
Type
select the specific type of quick action that you want to use.
•
If you selected Object, for
Object
search for and select the object that you want to filter by.
3. For
Action
, search for and select the action that you want to use.
4. Set field values for the action.
Rows that appear automatically represent the action’s required fields. To set values for the action’s optional fields, add rows.
391
Extend Salesforce with Clicks, Not Code
Field
Type
Value
Lightning Process Builder
Select the field whose value you want to set. To filter the drop-down list, type the name of the field.
You can set values for fields that are included in the action’s layout only.
Select the type of value that you want to use. The available types depend on the field that you’ve selected.
Set a value for the field. by using the text entry field to manually enter a value or the field picker to use a field value from a related record. See
Setting Values in the Process Builder
on page 372 for details.
5. Save the action.
Launch a Flow from a Process
Start an autolaunched flow from your process to automate complex business processes—create flows to perform logic and have events trigger the flows via processes—without writing code.
In order to launch a flow from a process, you must create and activate the flow. The flow must be autolaunched. For details, see
1. Enter a name for this action.
This text appears on the canvas and helps you differentiate this action from others in your process. The name truncates to fit on the canvas.
2. For
Flow
, search for and select the flow that you want to launch from this process.
Only active, autolaunched flows are available.
3. Optionally, click Add Row to set values for the flow’s variables.
Flow
Variable
Start typing the name of the flow variable whose value you want to set, or click to select a flow variable from the drop-down list.
You can set values for any variables in the flow that have
Input/Output
Type
set to Input Only or Input and Output.
Type
Value
Select the type of value that you want to set. For example, select String to manually enter the values for a Text collection variable, or select Reference to use the value of a record for an sObject variable.
Set a value for the flow variable.
•
For collection variables, use the text entry field to specify a value. The value must match the collection variable's data type.
•
For sObject variables, use the field picker to select an ID field. The ID must correspond to a record whose object type matches the sObject variable’s object type.
•
For sObject collection variables, use the field picker to select a related list. The selected records’ object type must match the sObject collection variable’s object type. For example, populate an sObject collection variable with all child contact records associated with the account that started the process.
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Enterprise,
Performance, Unlimited, and Developer Editions
USER PERMISSIONS
To create, edit, or view processes:
•
Manage Force.com Flow
AND
View All Data
392
Extend Salesforce with Clicks, Not Code Lightning Process Builder
Note:
If the related list is empty when the flow tries to populate the sObject collection variable with field values from those records, the process fails.
4. Save the action.
Send an Email from a Process
Easily send an email from a process by using an email alert. Email alerts are configured outside of the Process Builder and contain the standard text, list of recipients, and template for an email.
To send an email from a process, you must create the email alert
on page 660.
You can use only email alerts that are associated with the same object that the process is associated with. The record that started the process is used as the starting point for any merge fields that are used in the email alert.
After you’ve created an action and selected “Email Alerts” for the type, fill in the relevant fields to add the action to your process.
1. Enter a name for this action.
This text appears on the canvas and helps you differentiate this action from others in your process. The name truncates to fit on the canvas.
2. For
Email Alert
, type two or more letters to search for the email alert that you want to use to send an email.
3. Save the action.
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Professional,
Enterprise, Performance,
Unlimited, and Developer
Editions
USER PERMISSIONS
To create processes:
•
View All Data
Submit a Record for Approval from a Process
Submit the record that started the process for approval.
After you’ve created an action and selected “Submit for Approval” for the type, fill in the relevant fields to add the action to your process.
Only the record that started the process will be submitted. You can’t submit any related records for approval.
1. Enter a name for this action.
This text appears on the canvas and helps you differentiate this action from others in your process. The name truncates to fit on the canvas.
2. For
Approval Process
, indicate whether you need to submit the record through the default approval process or through a specific approval process.
The process fails if:
•
The record is submitted to the default approval process, and there are no active approval processes for the record’s object type.
•
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.
•
The record is submitted to a specific approval process, and it doesn’t meet the entry criteria.
3. If you need to submit the record to a specific approval process:
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Enterprise,
Performance, Unlimited, and Developer Editions
USER PERMISSIONS
To create, edit, or view processes:
•
Manage Force.com Flow
AND
View All Data
393
Extend Salesforce with Clicks, Not Code Lightning Process Builder
a. Search for and select the approval process.
b. Indicate whether you need to skip the entry criteria for the approval process.
4. For
Submitter
, identify who should receive notifications about the approval request.
Value
Current User
Description
The user who triggered the process by creating or editing a record.
User Field from a Record The user ID that’s stored in a field value on the record that’s being submitted for approval or another record.
Other User A specific user in your organization.
If the submitter isn’t an allowed initial submitter on the approval process that runs, the process fails. Make sure that the initial submitters for the approval processes that are related to this object include all users who could trigger this process. For details about
5. If necessary, enter submission comments. Don’t reference merge fields or formula expressions.
Submission comments appear in the approval history for the specified record. This text also appears in the initial approval request email if the template uses the
{!ApprovalRequest.Comments}
merge field.
6. Save the action.
Update Records from a Process
Update one or more records that are related to the record that started the process by manually entering values or by using the values from related records.
After you’ve created an action and selected “Update Records” for the action type, fill in the relevant fields to add the action to your process. The records’
Last Modified By
field is set to the user who started the process by creating or editing a record.
1. Enter a name for this action.
This text appears on the canvas and helps you differentiate this action from others in your process. The name truncates to fit on the canvas.
2. For
Record Type
, select the record or records that you need to update, and then click
Choose.
You can update only the record that started the process or records that are related to it. For example, you can reference
[Case].ContactId
, but not
[Case].Contact.AccountId
.
•
To update the record that started the process, click the appropriate radio button. For example, if your process is based on a case record, click next to Select the Case record
that started your process.
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Professional,
Enterprise, Performance,
Unlimited, and Developer
Editions
USER PERMISSIONS
To create, edit, or view processes:
•
Manage Force.com Flow
AND
View All Data
394
Extend Salesforce with Clicks, Not Code Lightning Process Builder
•
To update a record that’s related to the record that started the process, click the appropriate radio button and select one of the field names in the drop-down list.
If you select a field that ends in “ID,” you’re selecting a single record. This field name corresponds to a lookup field on the original
record. For details on lookup fields, see Custom Field Types
on page 137.
For example, if a case record started the process and you select
Account Id
, this action updates the account that’s associated with the case.
If you select a plural item that doesn’t end in “ID,” you’re updating all the records of that object type that are related to the record that started the process. This plural item corresponds to child records of the original record, which might appear in a related list on the original record.
For example, if you select CaseComments, this action updates all the case comments that are related to the case.
395
Extend Salesforce with Clicks, Not Code Lightning Process Builder
•
To update fields on a related record, click on a field with next to it (ending in “ID”) to access that record’s fields.
For example, let’s say that, for a process that evaluates a case record (1), you want to update all contacts that are related to the case’s parent account. Click Account ID (2), then Contacts (3), and then Choose.
3. Optionally, specify conditions to filter the records you’re updating.
For example, if your process updates the status of a parent case, specify conditions so that you won’t update the parent case if its status is set to On Hold.
Note: When you define conditions for updating records, you can’t:
•
Reference a Long Text Area field
•
Reference a Rich Text field
•
Reference a child record’s related fields
For example, you can reference
[Case].ContactId
, but not
[Case].Contact.AccountId
.
When you define multiple filters, the filter logic usually defaults to AND. However, if multiple filters have the same field selected and use the equals operator, the filters are combined with OR. For example, your filters check whether a case’s
396
Extend Salesforce with Clicks, Not Code Lightning Process Builder
Type equals Problem (1), Type equals Feature Request (2), and Escalated equals true (3). At runtime, those filters are combined to
(1 OR 2) AND 3
.
If you’re updating the record that started the process, Process Builder adds an implicit filter for you in the background:
[
Object].Id equals myCurrentVariable.Id
. If you add filter criteria that set the record’s ID to a value using the equals operator, at runtime the
[
Object].Id equals
filters are combined using OR filter logic. For example, you update the case that started the process and add this filter:
[Case].Id equals 500D00000044XgV
.
At runtime, your filter is combined with the implicit filter (
[Case].Id equals myCurrentVariable.Id
) with
OR.
a. Select Updated records meet all conditions.
b. Set the conditions that you want to use to filter the updated records.
Field
Select the field whose value you want to evaluate.
Operator
The available operators depend on the field’s data type.
Type
Value
The available value types depend on the field’ data type. See
Process Builder Value Types on page 373 for details.
Identify the value that you want to evaluate the field for.
For example, if your process updates account records, you can choose to update only accounts with an annual revenue (1) greater than (2) $1,000,000 (3).
4. Specify the new field values.
Field
Select the field whose value you want to set. To filter the drop-down list, type the name of the field.
You can assign values to fields only on the record or records that you identified in the
Object
field. Use a separate
Update Records action to update fields on related records.
Type
Value
Select the type of value that you want to use. The available types depend on the field that you’ve selected.
Set a value for the field. For example, if you select a Formula value type, click Build a formula... to create a formula value for the field.
5. Save the action.
397
Extend Salesforce with Clicks, Not Code Lightning Process Builder
Call Apex Code from a Process
Add customized functionality to your process by calling Apex from the process.
EDITIONS
After you’ve created an action and selected “Apex” for the type, fill in the relevant fields to add the action to your process.
Important: To use this action in a process, ask your developer to annotate the appropriate method with
@InvocableMethod
. For details, see “
InvocableMethod
Annotation” in the Apex Developer Guide.
The Apex class and the process are executed by the user whose action triggered the process.
1. Enter a name for this action.
This text appears on the canvas and helps you differentiate this action from others in your process. The name truncates to fit on the canvas.
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Professional,
Enterprise, Performance,
Unlimited, and Developer
Editions
USER PERMISSIONS
2. Choose an Apex class by entering the name of the class to filter results or select a class from the drop-down list.
3. If the class includes an invocable variable, you can manually enter values or reference field values from a related record.
The value must match the variable’s data type. You can set values for sObject and primitive type list variables only.
To create, edit, or view processes:
•
Manage Force.com Flow
AND
View All Data
•
To set values for sObject variables and sObject list values, reference an object’s related records, for example, all child contact records associated with the Account object that started the process.
•
To set a value for a primitive list variable (String, Integer, Time, and so on), select the String value type and enter a value in the text input field. You can’t pass multiple values to lists.
4. Click Save.
Note: If you define an Apex action in your process and then modify the Apex class by adding a standard field reference (for example,
User.Phone
), the Apex action is no longer visible in the process and must be added again.
398
Extend Salesforce with Clicks, Not Code Lightning Process Builder
Execute Actions on More Than One Criteria
Choose whether to stop or continue your process after specific criteria are met and associated actions execute.
For each criteria and associated action group, you can choose whether to stop the process after actions execute or continue evaluating the next defined criteria.
1. Make sure you’ve defined the next criteria and that your action group includes only immediate actions. You can’t evaluate the next criteria when an action group contains scheduled actions.
2. To change what happens after actions execute, click STOP (1) or EVALUATE THE NEXT
CRITERIA (2). Initially, each action group is set to stop after executing actions.
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Professional,
Enterprise, Performance,
Unlimited, and Developer
Editions
USER PERMISSIONS
To create, edit, or view processes:
•
Manage Force.com Flow
AND
View All Data
3. Save your changes, and your choice appears on the canvas.
399
Extend Salesforce with Clicks, Not Code Lightning Process Builder
Process Management
The Process Builder allows you to see and manage all your processes in one place.
To manage a process, from Setup, enter
Builder
in the
Quick Find
box, then select Process
Builder.
From the process management page, you can:
•
•
Edit a process
•
•
See the
status of your existing processes
•
Sort your processes by name, description, object, last modified date, or status
When you open a process, you can:
•
•
Activate or deactivate the process
•
From the Paused and Waiting Interviews list on the flow management page, you can:
•
that haven’t yet been executed
•
Delete groups of scheduled actions
that you no longer need to wait for
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Professional,
Enterprise, Performance,
Unlimited, and Developer
Editions
USER PERMISSIONS
To manage processes:
•
Manage Force.com Flow
AND
View All Data
Process Status
Each process has a status that determines whether the process can be edited, activated, or deleted.
Status
Active
Inactive
Description
The process has been activated.
You can’t make changes to an active process. However, you can clone it. Make any necessary changes to the cloned process and then activate it. Don’t forget to deactivate the original process if appropriate.
The process is inactive and can be activated.
Editable?
No
Yes
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Professional,
Enterprise, Performance,
Unlimited, and Developer
Editions
400
Extend Salesforce with Clicks, Not Code Lightning Process Builder
Clone a Process
If you want to make changes to an existing process, save a clone of that process. You can save the clone as either a new inactive process with its own version history, or as a new inactive version of the existing process.
To make changes to an active process, you have a few options.
•
Deactivate it, make changes, and then reactivate it.
•
Clone it as an inactive version, make changes, and then activate the new version. The original version is automatically deactivated.
•
Clone it as a new inactive process, make changes and then activate it. The original process is not automatically deactivated, so consider whether it’s appropriate for both processes to be active.
You can create up to 50 versions of a process, but only one version of a given process can be active.
1. From Setup, enter
Builder
in the
Quick Find
box, then select Process Builder.
2. Open the process or process version that you want to activate.
3. Click Clone.
4. You can create a version of the current process or a completely new process with its own version history.
5. Enter a name, API name, and description.
6. Click Save.
Activate a Process
Salesforce doesn’t start using a new or revised process to evaluate records until you activate it.
After you activate a process, you can no longer edit it. However, you can click Clone to save the process as a new inactive process.
You can’t activate a process unless it has:
•
At least one defined criteria node
•
At least one defined immediate or scheduled action
1. From Setup, enter
Builder
in the
Quick Find
box, then select Process Builder.
2. Open the process version that you want to activate.
3. Click Activate.
If you activate a version of a process that already has an active version, the previously active version is automatically deactivated. To see that version later, refer to the process’s version history.
After you’ve activated your process, consider creating or editing test records that will start the process to make sure it’s working correctly. If you do, remember to delete those test records or return them to their previous values once you’ve confirmed that your process works as designed.
If you later want Salesforce to stop using a process to evaluate records as they’re created or edited, open the active process and click Deactivate.
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Professional,
Enterprise, Performance,
Unlimited, and Developer
Editions
USER PERMISSIONS
To activate or deactivate processes:
•
Manage Force.com Flow
AND
View All Data
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Professional,
Enterprise, Performance,
Unlimited, and Developer
Editions
USER PERMISSIONS
To activate or deactivate processes:
•
Manage Force.com Flow
AND
View All Data
AND
Customize Application
401
Extend Salesforce with Clicks, Not Code Lightning Process Builder
Delete a Process Version
If you no longer need to use a process version that you’ve defined, delete it.
To delete an active process, you must first deactivate it. You can’t delete process versions with an
Active status. If another process references your invocable process, you can’t delete the invocable process. If a process has any scheduled actions, it can’t be deleted until those pending actions have
1. From Setup, enter
Builder
in the
Quick Find
box, then select Process Builder.
2. Click the name of the process whose version you want to delete.
3. For the version that you want to delete, click Delete.
If your process has only one version and you delete that version, the whole process is deleted.
4. Click OK.
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Professional,
Enterprise, Performance,
Unlimited, and Developer
Editions
USER PERMISSIONS
To delete processes:
•
Manage Force.com Flow
AND
View All Data
Monitor Your Processes’ Pending Scheduled Actions
To see which of your processes are still waiting to execute scheduled actions, see the Paused and
Waiting Interviews list on the flow management page.
1. From Setup, enter
Flows
in the
Quick Find
box, then select Flows.
2. Scroll down to the Paused and Waiting Interviews list.
3. Create a view to see scheduled actions in the Paused and Waiting Interviews list. We recommend displaying the following fields.
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Professional,
Enterprise, Performance,
Unlimited, and Developer
Editions
USER PERMISSIONS
•
Flow Name (1) corresponds to the process’s
Process Name
.
•
Paused Date (2) is the time at which the schedule started for the action group.
To see unexecuted scheduled actions:
•
View Setup and
Configuration
•
Current Element (3) identifies the group of scheduled actions that Salesforce is waiting to execute.
•
Type (4) indicates the type of a paused or waiting interview. Processes that are waiting to execute scheduled actions are of type
Workflow.
402
Extend Salesforce with Clicks, Not Code Lightning Process Builder
Current Element displays myWait_myRule_N
, where
N
is the number of the associated criteria and action group. For example, if
Current Element displays myWait_myRule_2
, Salesforce is waiting to execute the group of scheduled actions that are associated with the second criteria in the process.
SEE ALSO:
Delete Unexecuted Scheduled Actions
Delete Unexecuted Scheduled Actions
If you no longer need to wait for a process’s scheduled actions to be executed—for example, because you need to delete the associated process—you can delete the unexecuted group of scheduled actions.
1. From Setup, enter
Flows
in the
Quick Find
box, then select Flows.
The Waiting Interviews related list displays any unexecuted scheduled actions in your organization, as well as any waiting flow interviews.
2. For each unexecuted group of scheduled actions that you want to delete, click Del.
You can identify the correct row by the
Flow Name
field, which corresponds to the process’s
Process Name
.
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Professional,
Enterprise, Performance,
Unlimited, and Developer
Editions
SEE ALSO:
Monitor Your Processes’ Pending Scheduled Actions
USER PERMISSIONS
To delete unexecuted scheduled actions:
•
Manage Force.com Flow
Troubleshoot Processes
Use the error messages that appear in the Process Builder and the emails you receive when a process fails to help solve problems that arise when you’re working with processes. When all else fails, look at the Apex debug logs for your processes.
EDITIONS
Common Reasons Why Processes Fail
Here are some common design problems that cause processes to fail.
The API names for criteria nodes and actions are created in the background. When you create or update processes, you might see error messages that reference those names to help you identify specifically where the problem occurred.
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Professional,
Enterprise, Performance,
Unlimited, and Developer
Editions
What Happens When a Process Fails?
When a user performs an action that triggers a process (such as creating a record) and that process fails, the user sees a page with this error: “Workflow Action Failed to Trigger Flow.” In addition, the administrator who activated the process receives an email with more details.
403
Extend Salesforce with Clicks, Not Code Lightning Process Builder
Troubleshoot Processes with Apex Debug Logs
Use debug logs to find detailed information about your running processes after they finish running. For example, if a process doesn’t seem to trigger when a record meets the process’s criteria, or if you want to understand the sequence of processes being executed.
SEE ALSO:
Common Reasons Why Processes Fail
Common Reasons Why Processes Fail
Here are some common design problems that cause processes to fail.
•
A user creates or edits a person account. An Account-based process evaluates the record. The process’s criteria node references an account field, for example,
[Account].Name Equals
Acme
.
•
The process references a field that hasn’t been set. For example, you reference
[Contact].Account.Description
in your process. If the Account lookup field isn’t set on the contact, the process fails because it doesn’t know which account to reference.
The workarounds for this issue depend on where the reference exists in the process.
–
If you reference it in filter conditions, add another filter condition that checks whether the lookup field is set. You can do the same workaround if it’s referenced in a formula, for example,
[Contact].AccountId Is null False
.
–
Otherwise, consider making the fields required.
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Professional,
Enterprise, Performance,
Unlimited, and Developer
Editions
SEE ALSO:
What Happens When a Process Fails?
Errors in the Process Builder
The API names for criteria nodes and actions are created in the background. When you create or update processes, you might see error messages that reference those names to help you identify specifically where the problem occurred.
API Name Description
myVariable_current.field
field
is the name of the field that’s referenced.
myVariable_current
refers to the field values that the record had when it started the process.
For example, myVariable_current.Id
corresponds to the record’s field value for
Id
when the record started the process.
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Professional,
Enterprise, Performance,
Unlimited, and Developer
Editions
404
Extend Salesforce with Clicks, Not Code
API Name
myVariable_old.field
Lightning Process Builder
Description
field
is the name of the field that’s referenced. myVariable_old
refers to the most recent previous values of the record that started the process.
For example, myVariable_old.Id
corresponds to the record’s field value for
Id
immediately before the record started the process.
Example:
The element has an invalid reference to “myVariable_current.AnnualRevenue”.
myVariable_current.AnnualRevenue
refers to the value for the field
AnnualRevenue
when the record started the process.
Note: Error or warning messages might refer to a “flow” instead of a “process.” Those messages still apply to your process.
SEE ALSO:
Common Reasons Why Processes Fail
What Happens When a Process Fails?
When a user performs an action that triggers a process (such as creating a record) and that process fails, the user sees a page with this error: “Workflow Action Failed to Trigger Flow.” In addition, the administrator who activated the process receives an email with more details.
The email includes the element that failed, the error message from that failure, and details about the criteria and actions that the process tried to execute. The subject line is
Error Occurred
During Flow “Process_Name”: Error
.
Example:
Error Occurred During Flow "Opportunity_Management": No applicable approval process was found.
// The error occurred when the LeadConvertEmail process was triggered.
An error occurred at element myRule_1_A1 (FlowActionCall).
No applicable approval process was found.
// The error occurred at the first action (A1) that’s associated with the
// first criteria node (myRule_1).
Flow Details
Flow Name: Opportunity_Management
Type: Workflow
Version: 3
Status: Active
// The user triggered version 3 of the Opportunity_Management process.
Flow Interview Details
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Professional,
Enterprise, Performance,
Unlimited, and Developer
Editions
405
Extend Salesforce with Clicks, Not Code Lightning Process Builder
Interview Label: Opportunity_Management-3_Opportunity
Current User: Madison Rigsby (0051a000000qJXL)
Start time: 2/2/2017 11:21 AM
Duration: 0 seconds
// The process was triggered by user Madison Rigsby.
How the Interview Started
Madison Rigsby (0051a000000qJXL) started the flow interview.
Some of this flow's variables were set when the interview started.
myVariable_old = 0061a00000D3ibfAAB myVariable_current = 0061a00000D3ibfAAB
ASSIGNMENT: myVariable_waitStartTimeAssignment
{!myVariable_waitStartTimeVariable} Equals {!Flow.CurrentDateTime}
Result
{!myVariable_waitStartTimeVariable} = "2/2/2017 11:21 AM"
DECISION: myDecision
Executed this outcome: myRule_1
Outcome conditions: and
1. {!myVariable_current.StageName} (Proposal/Price Quote) Equals Proposal/Price Quote
Logic: All conditions must be true (AND)
// The first criteria node (myRule_1) checks whether the opportunity’s StageName
// is “Proposal/Price Quote”. It is, so the process moves on to execute the associated
// actions.
SUBMIT FOR APPROVAL: myRule_1_A1
Inputs: objectId = {!myVariable_current.Id} (0061a00000D3ibfAAB) comment = null
Error Occurred: No applicable approval process was found.
// The process tries to execute the first associated action.
// The action fails because no approval processes exist that
// the record can be submitted to. Maybe the org doesn’t include
// any active Opportunity approval processes. Or maybe it does, but the
// record doesn’t meet the entry criteria for any of them.
SEE ALSO:
Common Reasons Why Processes Fail
406
Extend Salesforce with Clicks, Not Code Lightning Process Builder
Troubleshoot Processes with Apex Debug Logs
Use debug logs to find detailed information about your running processes after they finish running.
For example, if a process doesn’t seem to trigger when a record meets the process’s criteria, or if you want to understand the sequence of processes being executed.
EDITIONS
Tip: Make sure that your filters include FINER events in the WORKFLOW category. For details, see Debug Log Levels.
Available in: both Salesforce
Classic and Lightning
Experience
When using debug logs to troubleshoot a process, consider the following.
•
Processes created in the Process Builder appear as flows and workflow rules in debug logs. The generated names have some resemblance to the process names, but they don’t map one-to-one.
•
Standard processes appear as flows of type Workflow. Invocable processes appear as flows of type InvocableProcess.
Available in: Professional,
Enterprise, Performance,
Unlimited, and Developer
Editions
•
Immediate actions that may appear to be executed in a block are strung together in the flow. If one action fails in the middle, then the following actions might not run.
•
Scheduled actions are executed after a Wait element. The actions are executed similarly to immediate actions after the process resumes.
•
WF_CRITERIA_BEGIN
and
WF_CRITERIA_END
refer to the workflow rule criteria that is always set to true and not the criteria defined in your process.
•
Here’s how elements in the Process Builder correspond to flow debug events.
Flow Debug Event Process Builder
Element
Criteria
Create a Record
Update Records
Post to Chatter
Submit for Approval
Email Alerts
Flows
Processes
Apex
Schedule
FLOW_RULE_...
FLOW_ELEMENT_...
FLOW_ELEMENT_...
FLOW_ACTIONCALL_...
FLOW_ACTIONCALL_...
FLOW_ACTIONCALL_...
FLOW_ACTIONCALL_...
FLOW_ACTIONCALL_...
FLOW_ACTIONCALL_...
FLOW_WAIT_...
Example:
Debugging Immediate Actions
This example covers a process with an immediate Apex action.
Here’s what you can tell from this first snippet.
•
The process is triggered by a lead with the name “L104”.
•
The name of the process is “Apex Say Hello”, which corresponds with the name used in the log
“Apex_Say_Hello301xx000000001Y”. The number appended to the end of the name is the process version’s ID.
407
Extend Salesforce with Clicks, Not Code Lightning Process Builder
•
The process is set to trigger when a record is created or edited (ON_ALL_CHANGES).
17:07:29.086 (86806000)|EXECUTION_STARTED
17:07:29.086 (86928000)|CODE_UNIT_STARTED|[EXTERNAL]|
Workflow:Lead
17:07:29.113 (113974000)|WF_RULE_EVAL_BEGIN|Assignment
17:07:29.114 (114043000)|WF_SPOOL_ACTION_BEGIN|Assignment
17:07:29.114 (114060000)|WF_ACTION|.
17:07:29.114 (114071000)|WF_RULE_EVAL_END
17:07:29.114 (114093000)|WF_RULE_EVAL_BEGIN|Workflow
17:07:29.114 (114178000)|WF_CRITERIA_BEGIN|
[
Lead: L104 00Qxx000002S8vh]|Apex_Say_Hello301xx000000001Y|
01Qxx0000002nea|
ON_ALL_CHANGES|0
In this section, the process compares the record’s current values to the values it had before it was changed. “myVariable_current” contains all of the record’s current field values. “myVariable_old” contains all of the field values of the record immediately before it was changed. “myVariable_old” has no values (null), so the process is evaluating a newly created lead.
17:07:29.114 (114553000)|WF_FORMULA|
Formula:ENCODED:[treatNullAsNull]true|Values:
17:07:29.114 (114571000)|WF_CRITERIA_END| true
17:07:29.132 (132792000)|WF_SPOOL_ACTION_BEGIN|
Workflow
17:07:29.132 (132881000)|WF_ACTION|
Flow Trigger: 1;
17:07:29.132 (132897000)|WF_RULE_EVAL_END
17:07:29.137 (137127000)|WF_FLOW_ACTION_BEGIN|
09Lxx000000000B
17:07:29.137 (137249000)|WF_FLOW_ACTION_DETAIL|
09Lxx000000000B|[Lead: L104 00Qxx000002S8vh]|Id=09Lxx000000000B|
CurrentRule:Apex_Say_Hello301xx000000001Y (Id=01Qxx0000002nea)
17:07:29.139 (139429000)|FLOW_CREATE_INTERVIEW_BEGIN|
00Dxx0000001gH6|300xx00000002cI|301xx000000001Y
17:07:29.140 (140996000)|FLOW_CREATE_INTERVIEW_END|
108a970cb7aeabf8804183a600514a3bb92516-7f92|Apex Say Hello 2
17:07:29.142 (142898000)|WF_FLOW_ACTION_DETAIL|Param Name: myVariable_current,
Param Value: ENCODED:{![treatNullAsNull]{!ID:this}},
Evaluated Param Value:{
LastModifiedByID=005xx000001SwUpAAK, LastTransferDate=2014-12-12 01:07:29,
ConnectionReceivedDate=null, LastModifiedDate=2014-12-12 01:07:29, LeadSource=null,
LastName=L104, NumberofLocations__c=null, NumberOfEmployees=null,
DandbCompanyId=null,
DoNotCall=false, Primary__c=null, CreatedByID=005xx000001SwUpAAK,
ConnectionSentDate=null,
MobilePhone=null, Jigsaw=null, Salutation=null, HasOptedOutOfEmail=false,
Country=null, LastViewedDate=null, ConvertedOpportunityId=null,
EmailBouncedReason=null,
Email=null, Rating=null, SICCode__c=null, CleanStatus=Pending,
CreatedById=005xx000001SwUpAAK,
IsDeleted=false, Longitude=null, Id=00Qxx000002S8vhEAC, Industry=null, Street=null,
Phone=null, IsConverted=false, EmailBouncedDate=null, HasOptedOutOfFax=false,
OwnerId=005xx000001SwUpAAK, AnnualRevenue=null, CompanyDunsNumber=null,
IsUnreadByOwner=true,
408
Extend Salesforce with Clicks, Not Code Lightning Process Builder
LastActivityDate=null, SystemModstamp=2014-12-12 01:07:29, ProductInterest__c=null,
Latitude=null, FirstName=null, PhotoUrl=null, Company=LC,
CampaignMemberStatus=null,
Description=null, LastReferencedDate=null, LastModifiedById=005xx000001SwUpAAK,
Website=null, Fax=null, InternalSource=0, City=null, Title=null,
MasterRecordId=null,
CampaignId=null, Status=Open - Not Contacted, JigsawContactId=null,
ConvertedDate=null,
PostalCode=null, State=null, CreatedDate=2014-12-12 01:07:29,
ConvertedContactId=null,
ConvertedAccountId=null, CurrentGenerators__c=null
}|
Param Name: myVariable_old,
Param Value: {!old},
Evaluated Param Value:
null
This section shows the start of the process—indicated by “FLOW_START_INTERVIEWS_BEGIN”—and the criteria defined in the process. “FLOW_RULE_” always corresponds to criteria in the process, and we see that “myRule_1” is evaluated as “true”. The number in “myRule_1” indicates that the process is executing the group of scheduled actions that are associated with the first criteria in the process.
17:07:29.143 (143184000)|
FLOW_START_INTERVIEWS_BEGIN|1
17:07:29.147 (147213000)|FLOW_START_INTERVIEW_BEGIN|
108a970cb7aeabf8804183a600514a3bb92516-7f92|Apex Say Hello 2
17:07:29.147 (147389000)|FLOW_VALUE_ASSIGNMENT|
108a970cb7aeabf8804183a600514a3bb92516-7f92|myVariable_old|
17:07:29.148 (148138000)|FLOW_VALUE_ASSIGNMENT|
108a970cb7aeabf8804183a600514a3bb92516-7f92|myVariable_current|{
LastModifiedByID=005xx000001SwUpAAK, LastTransferDate=2014-12-12 01:07:29,
ConnectionReceivedDate=null, LastModifiedDate=2014-12-12 01:07:29, LeadSource=null,
LastName=L104, NumberofLocations__c=null, NumberOfEmployees=null,
DandbCompanyId=null,
DoNotCall=false, Primary__c=null, CreatedByID=005xx000001SwUpAAK,
ConnectionSentDate=null,
MobilePhone=null, Jigsaw=null, Salutation=null, HasOptedOutOfEmail=false,
Country=null,
LastViewedDate=null, ConvertedOpportunityId=null, EmailBouncedReason=null,
Email=null,
Rating=null, SICCode__c=null, CleanStatus=Pending, CreatedById=005xx000001SwUpAAK,
IsDeleted=false, Longitude=null, Id=00Qxx000002S8vhEAC, Industry=null, Street=null,
Phone=null, IsConverted=false, EmailBouncedDate=null, HasOptedOutOfFax=false,
OwnerId=005xx000001SwUpAAK, AnnualRevenue=null, CompanyDunsNumber=null,
IsUnreadByOwner=true,
LastActivityDate=null, SystemModstamp=2014-12-12 01:07:29, ProductInterest__c=null,
Latitude=null, FirstName=null, PhotoUrl=null, Company=LC,
CampaignMemberStatus=null,
Description=null, LastReferencedDate=null, LastModifiedById=005xx000001SwUpAAK,
Website=null,
409
Extend Salesforce with Clicks, Not Code Lightning Process Builder
Fax=null, InternalSource=0, City=null, Title=null, MasterRecordId=null,
CampaignId=null,
Status=Open - Not Contacted, JigsawContactId=null, ConvertedDate=null,
PostalCode=null,
State=null, CreatedDate=2014-12-12 01:07:29, ConvertedContactId=null,
ConvertedAccountId=null,
CurrentGenerators__c=null
}
17:07:29.148 (148427000)|FLOW_ELEMENT_BEGIN|
108a970cb7aeabf8804183a600514a3bb92516-7f92|FlowDecision|myDecision
17:07:29.149 (149938000)| FLOW_RULE_DETAIL|
108a970cb7aeabf8804183a600514a3bb92516-7f92| myRule_1|true
17:07:29.149 (149976000)|FLOW_VALUE_ASSIGNMENT|
108a970cb7aeabf8804183a600514a3bb92516-7f92|myRule_1|true
17:07:29.150 (150050000)|FLOW_ELEMENT_END|
108a970cb7aeabf8804183a600514a3bb92516-7f92|FlowDecision|myDecision
In this section, the immediate actions for the first criteria are executed. In the name “myRule_1_A1”, “A1” indicates that this corresponds to the first action in the action group. We also see the Apex class “SayHello.sayHello” and the details of the Apex class execution. Then the process finishes with no errors.
17:07:29.150 (150117000)|FLOW_ELEMENT_BEGIN|
108a970cb7aeabf8804183a600514a3bb92516-7f92|FlowActionCall|
myRule_1_A1
17:07:29.150 (150146000)|FLOW_ELEMENT_DEFERRED|
FlowActionCall|myRule_1_A1
17:07:29.150 (150194000)|FLOW_ELEMENT_END|
108a970cb7aeabf8804183a600514a3bb92516-7f92|FlowActionCall|myRule_1_A1
17:07:29.150 (150233000)|FLOW_START_INTERVIEW_END|
108a970cb7aeabf8804183a600514a3bb92516-7f92|Apex Say Hello 2
17:07:29.150 (150316000)|FLOW_BULK_ELEMENT_BEGIN|
FlowActionCall|myRule_1_A1
17:07:29.151 (151772000)|CODE_UNIT_STARTED|
[EXTERNAL]|01pxx00000000DN|
SayHello.sayHello
17:07:29.153 (153773000)|METHOD_ENTRY|
[1]|01pxx00000000DN|SayHello.SayHello()
17:07:29.153 (153821000)|METHOD_EXIT|
[1]|SayHello
17:07:29.154 (154292000)|SYSTEM_CONSTRUCTOR_ENTRY|
[4]|<init>()
17:07:29.154 (154392000)|SYSTEM_CONSTRUCTOR_EXIT|
[4]|<init>()
17:07:29.154 (154564000)|SYSTEM_METHOD_ENTRY|
[5]|List<String>.add(Object)
17:07:29.154 (154748000)|SYSTEM_METHOD_EXIT|
[5]|List<String>.add(Object)
17:07:29.084 (154888000)|CUMULATIVE_LIMIT_USAGE
17:07:29.084|LIMIT_USAGE_FOR_NS|(default)|
Number of SOQL queries: 0 out of 100
Number of query rows: 0 out of 50000
Number of SOSL queries: 0 out of 20
Number of DML statements: 0 out of 150
Number of DML rows: 0 out of 10000
410
Extend Salesforce with Clicks, Not Code Lightning Process Builder
Maximum CPU time: 0 out of 10000
Maximum heap size: 0 out of 6000000
Number of callouts: 0 out of 100
Number of Email Invocations: 0 out of 10
Number of future calls: 0 out of 50
Number of queueable jobs added to the queue: 0 out of 50
Number of Mobile Apex push calls: 0 out of 10
17:07:29.084|CUMULATIVE_LIMIT_USAGE_END
17:07:29.154 (154949000)|CODE_UNIT_FINISHED|
SayHello.sayHello
17:07:29.155 (155090000)|FLOW_ACTIONCALL_DETAIL|
108a970cb7aeabf8804183a600514a3bb92516-7f92|myRule_1_A1|Call Apex|SayHello|true|
17:07:29.155 (155133000)|FLOW_VALUE_ASSIGNMENT|
108a970cb7aeabf8804183a600514a3bb92516-7f92|myRule_1_A1|true
17:07:29.155 (155268000)|FLOW_BULK_ELEMENT_END|
FlowActionCall|myRule_1_A1|0|4
17:07:29.155 (155371000)|FLOW_START_INTERVIEWS_END|
1
17:07:29.159 (159563000)|WF_FLOW_ACTION_END|
09Lxx000000000B
17:07:29.159 (159787000)|WF_ACTIONS_END|
Flow Trigger: 1;
17:07:29.159 (159815000)|CODE_UNIT_FINISHED|
Workflow:Lead
17:07:29.161 (161221000)|EXECUTION_FINISHED
Example:
Debugging Scheduled Actions
This example highlights parts of a debug log for a process with a scheduled Post to Chatter action.
A schedule is always indicated by “myWait_”. This section shows the process’s running schedule “myWait_myRule_2”. Any events that start with “FLOW_WAIT_” also correspond to a schedule in a process.
20:06:28.928 (928266000)|FLOW_ELEMENT_BEGIN|
345ad8ae889702ab70b5df5712b14a3c990e9d-7ea5|WaitInfo|
myWait_myRule_2
20:06:28.928 (928302000)|FLOW_ELEMENT_DEFERRED|
WaitInfo|myWait_myRule_2
20:06:28.928 (928361000)|FLOW_ELEMENT_END|
345ad8ae889702ab70b5df5712b14a3c990e9d-7ea5|WaitInfo|myWait_myRule_2
20:06:28.929 (929671000)|FLOW_BULK_ELEMENT_BEGIN|
WaitInfo|myWait_myRule_2
20:06:29.005 (1005229000)|
FLOW_WAIT_EVENT_WAITING_DETAIL|
345ad8ae889702ab70b5df5712b14a3c990e9d-7ea5|myWait_myRule_2| myWaitEvent_myRule_2|alarmDateRef|true
20:06:29.005 (1005317000)|FLOW_VALUE_ASSIGNMENT|
345ad8ae889702ab70b5df5712b14a3c990e9d-7ea5|myWaitEvent_myRule_2|true
20:06:30.225 (2225117000)| FLOW_WAIT_WAITING_DETAIL|
345ad8ae889702ab70b5df5712b14a3c990e9d-7ea5|myWait_myRule_2|1|0Foxx0000000001
20:06:30.225 (2225362000)|FLOW_BULK_ELEMENT_END|
WaitInfo|myWait_myRule_2|0|1296
411
Extend Salesforce with Clicks, Not Code Lightning Process Builder
...
20:06:30.234 (2234916000)|WF_TIME_TRIGGERS_BEGIN
20:06:30.248 (2248007000)|WF_ACTIONS_END|
Flow Trigger: 1;
20:06:30.248 (2248072000)|CODE_UNIT_FINISHED|
Workflow:Lead
20:06:30.250 (2250129000)|EXECUTION_FINISHED
For scheduled actions, the debug log shows an additional log when the scheduled actions are performed. This is a separate entry in the debug log, as shown in the following example for this scheduled Post to Chatter action. After the scheduled time occurs, an automated process executes the scheduled actions. The log uses coordinated universal time (UTC) instead of the user’s time zone. However, the actions are still executed as the user who originally caused the process to run.
“FLOW_WAIT_EVENT_RESUMING_DETAIL” indicates that the interview is being resumed so that the process can execute its scheduled actions. “alarmDateRef” indicates that this schedule is based on a field value. We then see that the Post to Chatter action is executed.
00:14:10.466 (1418357225466561000)|FLOW_BULK_ELEMENT_BEGIN|
WaitInfo|myWait_myRule_2
00:14:10.469 (1418357225469327000)|
FLOW_WAIT_EVENT_RESUMING_DETAIL|
345ad8ae889702ab70b5df5712b14a3c990e9d-7ea5|myWait_myRule_2| myWaitEvent_myRule_2|
alarmDateRef
00:14:10.469 (1418357225469412000)|FLOW_WAIT_RESUMING_DETAIL|
345ad8ae889702ab70b5df5712b14a3c990e9d-7ea5|myWait_myRule_2|
0Foxx000000000100:14:10.469 (1418357225469733000)|
FLOW_BULK_ELEMENT_END|WaitInfo|myWait_myRule_2|0|3
00:14:10.469 (1418357225469826000)|FLOW_ELEMENT_BEGIN|
345ad8ae889702ab70b5df5712b14a3c990e9d-7ea5|
FlowDecision|myPostWaitDecision_myRule_2
00:14:10.471 (1418357225471235000)|FLOW_RULE_DETAIL|
345ad8ae889702ab70b5df5712b14a3c990e9d-7ea5|myPostWaitRule_myRule_2|true
00:14:10.471 (1418357225471275000)|FLOW_VALUE_ASSIGNMENT|
345ad8ae889702ab70b5df5712b14a3c990e9d-7ea5|myPostWaitRule_myRule_2|true
00:14:10.471 (1418357225471348000)|FLOW_ELEMENT_END|
345ad8ae889702ab70b5df5712b14a3c990e9d-7ea5|
FlowDecision|myPostWaitDecision_myRule_2
00:14:10.471 (1418357225471441000)|FLOW_ELEMENT_BEGIN|
345ad8ae889702ab70b5df5712b14a3c990e9d-7ea5|
FlowActionCall|myRule_2_SA1
00:14:10.471 (1418357225471486000)|FLOW_ELEMENT_DEFERRED|
FlowActionCall|myRule_2_SA1
00:14:10.471 (1418357225471551000)|FLOW_ELEMENT_END|
345ad8ae889702ab70b5df5712b14a3c990e9d-7ea5|
FlowActionCall|myRule_2_SA1
00:14:10.471 (1418357225471624000)|FLOW_BULK_ELEMENT_BEGIN|
FlowActionCall|myRule_2_SA1
00:14:10.841 (1418357225841584000)|FLOW_ACTIONCALL_DETAIL|
345ad8ae889702ab70b5df5712b14a3c990e9d-7ea5| myRule_2_SA1|
Post to Chatter|chatterPost|true|
00:14:10.841 (1418357225841661000)|FLOW_VALUE_ASSIGNMENT|
345ad8ae889702ab70b5df5712b14a3c990e9d-7ea5|myRule_2_SA1|true
412
Download
Advertisement