Salesforce process builder is a powerful tool you can use to automate business processes. It has a simple interface that allows you to point and click to select objects and fields while setting up immediate and time-based actions. A Process builder allows you to do more than a simple workflow would. It is a tool that allows you to automate business processes using a graphical representation of your process. It is like a workflow tool that helps you easily automate your business processes by providing a powerful and user-friendly visual representation of your process. The Process Builder’s simple and powerful design allows you to build customize the automated process.
Actions Available In Process Builder
There are several different actions you can trigger the process builder. These actions are:
Trigger Apex code: You can use the Salesforce process builder to invoke Apex code you have written within Salesforce. Apex can be anything from custom logic to save a record to complex business processes. To invoke an apex class in process builder we have to use @AuraEnabled attribute.
Create a record: This will allow you to create new records and set certain field values for the new record.
Email alerts: IN order to send an email from a process, you must create the email alert. To send an email alert that email should be associated with the same object on which process is started. Email template contains the standard text, list of recipients, and template
Trigger a flow: You can launch a flow from your process to automate complex business processes.
Post to Chatter: Process builder post to chatter action helps to post information to any user or group chatter feed within Salesforce. The post will appear in the chatter field as if the person who triggered the process had written it. You can reference groups or topics and add merge fields.
Submit for approval: Only the record that started the process will be submitted. You can’t submit any related records for approval.
Update records: Update one or more records that are related to the record that started the process. You can update the record with manually entered values or by using the values from related records. We can update records of parent or child whereas workflow only updates same or parent object from the child.
Quick actions: You must already have global actions or an object specific action created within Salesforce to use these quick actions. You can then select to log a call, send an email, or update a record.
Process: This action will call another process to another process. For this action, you need to choose process type as it invoked by another process.
Why Process builder?
The process builder is more flexible in comparison to the workflow. In workflow rule can’t update child record, Post to Chatter, auto submits record in the Approval process, invoke an apex or call flows.
Salesforce Training For Administrators & Developers
Choose an email alert name if you do not have an email alert create a new one.
Choose action type as an
Enter name.
Select apex class
Save
Activate
Apex code
public class invokeAppoveExample {
@InvocableMethod
public static void recordInsert(list<id>ids){
list<account>acc= [select id from account where id in:ids];
for(account a :acc){
opportunity op = new opportunity();
op.Name=a.Name;
op.CloseDate=system.today();
op.StageName='closed won';
op.AccountId=a.id;
op.Amount=a.AnnualRevenue;
insert op;
}
}
}
Now go to account update it sees its related contact will be updated, you will also a notification of address update
With this blog, you have learned what is a process builder in Salesforce and how it works. Let us summarize the blog in a few points. You can perform the following actions with process builder:-
Create and update records
Send an Email alert
Submit a record for approval
Invoke a process from another process
Launch a flow
We can call apex methods
Post to chatter
If you have any queries related to process builder in Salesforce then drop your query in the comment section below. Happy learning!
A dynamic, highly professional, and a global online training course provider committed to propelling the next generation of technology learners with a whole new way of training experience.