December 27, 2020

Process Automation(Workflow, Process Builder, Flow, Trigger) Best Practices in Salesforce

1. Have one Automation per object. Have one Flow/Process Builder(Master) per object(Auto-Launched). Use sub-flow/sub-process to call other processes from the master.

2. Don't select "Automatically store all fields" in "How to Store Record Data" section when using the "Get Records" Flow component. It fetches Formula fields, Rich Text fields, Long Text-area fields, etc. Instead, select "Choose fields and let Salesforce do the rest" or "Choose fields and assign variables (advanced)".

3. If the records from the object will be inserted/updated from an integration in Bulk, then
a. Use Trigger for better performance
b. Don't filter Integration users in the Automation criteria. It may skip the automation. But, still it checks the criteria and consumes time.

4. For updates on the same object, use "Record-Triggered Flow" and use Run Flow as "Before the record is saved". This avoids unnecessary DML Operation.

5. Avoid recursion.

6. Don't mix and match all Process Automation together.

Note:
1. Thoroughly test in a Sandbox. Check the performance before deploying it to production environment.

2. Debug Log is a great resource to find/investigate how much time each action takes.

Check the below link for additional information
https://help.salesforce.com/articleView?id=process_considerations_design_bestpractices.htm&type=5

Check the below link for Triggers Best Practices
https://www.infallibletechie.com/2014/10/triggers-best-practices-in-salesforce.html

No comments:

Post a Comment