
Process Builder in Salesforce - Everything You Need to Know
Types of Actions Available in Process Builder
Creating Records: We can insert new records with either new values or reference field values from the related object that triggered the Process.
Email Alerts: We can send email alerts triggered when a specific update occurs on a record.
Posting on Chatter: We can use this tool to post updates on the Chatter feed regarding any information the user is subscribed to receive updates.
Quick action: We can use Process Builders to launch quick actions. It is to be noted that the Quick Action must already be existent in the org before choosing this action in the Process Builders.
Launching/triggering the flow: We can use Process Builder to launch a Lightning Flow by passing parameters to it for further processing.
Submitting the record automatically for approval: We can submit the record that started the Process for approval from designated authorities for further processing.
Calling an Apex class: You can invoke apex methods annotated by @InvocableMethod in an apex class for further processing.
Invoking another process: We can invoke one process builder from another.
Send Custom Notifications: We can send custom notifications that will notify when specific criteria are met. We can also define the content and the title of the notification and the recipient.
Update records: Update related records that triggered the process; we can update child records from parent records in process builders.
Quip: Use Process Builder to add documents, spreadsheets, chatrooms, and notifications into Salesforce instances.
Let's take a simple use case scenario where whenever the account record’s address fields get updated, we want to update the address field on the contacts with the same values.
To create a new process builder, we go to the gear icon and go to setup and search for Process Builder and click on the option, and then click on New.
Don't forget to check out: Mass/Bulk Insert Custom MetaData Records through CSV | Salesforce Developer Guide
Choose the Event when the Process Starts
Provide the Process Name and API Name, new process creation gives us the following option to choose from. This essentially allows us to define the entry criteria event. Since we want our process to start when the record changes, we will select the option “A record changes”.
Defining the Object to Start the Process
We define the object on which the process will run and also select from the option to start the process when a record is created or edited of the selected Object. For our purpose, we want the process to fire on the Account object whenever a record is created or edited. and then click on Save.
Define Criteria for the Action Group
Next, we define the specific values that the record must-have for the process to fire. This is essentially a way to make the defined Process fire on the object selected in the previous step, only when its record matches a predefined value. For our purpose, we want the process to fire without criteria, so we select the last option “ No criteria- just execute the action!”
Check out another amazing blog by Anshu here: How to Freeze and Deactivate User Accounts in Salesforce
Define the Action
Here we define the action which will take place once all the above-mentioned conditions are satisfied. For our purpose, we select the Update records option from the Action Name. Now since we already know the Process builder allows updating of the child (Contacts) object records from the parent (Account) object records, we will get the 'Select a record related to the Account’. Optionally, we can define criteria to specify the value of the contacts record for the action to occur. Next, we set the field values for the update to take place. We choose some address related fields of Contact and set the values from the address fields on the Account object record that fired the process. Now Save and Activate the Process.
Limitations
- We cannot delete records using Process Builder.
- A Process may have up to 50 Versions, but only a single Version can be “Active”.
- Update unrelated records.
Responses