Step By Step Guide To Creating Record-Triggered Flow in Salesforce : Adwait Gogate
by: Adwait Gogate
blow post content copied from Ashish Agarwal – Salesforce.com Architect & Blogger
click here to view original post
Update Child Records When There is a Change in Parent Record
![salesforce record triggered flow](https://amazon.asagarwal.com/images/2021_02_23_salesforce_record_triggered_flow.png)
Record-Triggered Flow in Salesforce is one of the many types of Flows that you can use to automate your business processes. You can trigger the Flow when:
- A record is created
- A record is updated
- A record is created or updated
- A record is deleted
And run the Flow:
- Before the record is saved
- After the record is saved
With record-triggered flows you can potentially avoid writing triggers. Now you have the option of meeting complex business processes without writing a single line of code.
Flow is the future of automation in Salesforce and is becoming increasingly powerful with every release. If you are still using Workflow Rules and/or Process Builders to build new automations in Salesforce, I urge you to switch to flows and avoid incurring technical debt.
Spring ‘21 Release Update – Refer to the Prior Values of the Record That Triggered Your Flow
Now when an object’s record is updated, you can access that record’s earlier values in Salesforce Flow. The ‘$Record__Prior’ global variable contains the record’s values immediately before the Flow was run. You can use these values to check for changes in fields and calculate differences in your flow. This acts as an ‘ISCHANGED’ condition in Process Builder which we have made maximum use of in the past. So now you can take benefit of it in Flow and build logic around it.
For this guide, we will be covering how to use the aforementioned ‘$Record__Prior’ global variable in Salesforce Flow. After going through this guide, within the next 20 minutes, you will learn how to:
- Create a Record-Triggered Flow
- Save & Activate the Screen Flow
- Test the Screen Flow
In this guide, we will be creating a Flow to update all the Contacts’ addresses when the related Account address changes. Earlier it could be done using Process Builder, but now you can incorporate it in your Flows using ‘$Record__Prior’ global variable.
References & Useful URLs:
- Flow Types – Help Article (10 mins) –
https://help.salesforce.com/articleView?id=sf.flow_concepts_type.htm&type=5 - Refer to the Prior Values of the Record That Triggered Your Flow – Spring ’21 Release Notes Article (5 mins) – https://help.salesforce.com/articleView?id=release-notes.rn_forcecom_flow_fbuilder_prior_values_flow.htm&type=5&release=230
- With so many different automation features in Salesforce like validation rules, workflow rules, process builder, flows, apex triggers, assignment rules, escalation rules, auto-response rules etc., it is important for you to understand the order in which these rules will be executed. To download a infographic on the order in which these rules will be executed, please refer to my another blog post (10 mins) – Order of Execution (Rules, Triggers etc.) in Salesforce & Debug Log
The post Step By Step Guide To Creating Record-Triggered Flow in Salesforce appeared first on Ashish Agarwal - Salesforce.com Architect & Blogger.
February 23, 2021 at 03:30AM
Click here for more details...
=============================
The original post is available in Ashish Agarwal – Salesforce.com Architect & Blogger by Adwait Gogate
this post has been published as it is through automation. Automation script brings all the top bloggers post under a single umbrella.
The purpose of this blog, Follow the top Salesforce bloggers and collect all blogs in a single place through automation.
============================
![Salesforce Salesforce](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgxyr0-tn0D8T8tDMbp_O89UlQ83Cuvk03CiOdvQtWP3XWmrDX-5bBbspYlHpwENo7DTEk-GK9QD6aod-pjThPRwxoEy0TDuuIRVqTr5eVnuFW1Mh581B6ohWxr6C9UuA3a9E3ot2SlNyw/s784/4.png)
Post a Comment