Table of Content
Salesforce transformed how businesses' marketing and sales teams previously operated. You should be aware of the chronological order in which processes are carried out if you're a Salesforce consultant or developer. We will talk about Salesforce, the purpose of Order of Execution in Salesforce, and its advantages in this article. By the end of 2021, Gartner projects that revenue in the Enterprise Software segment will exceed US$230 million. To keep up with the current technological era, businesses are turning more and more to technical CRMs. There are several rules in Salesforce that may be applied to objects and fields. Salesforce allows you to define various rules, such as validation rules, escalation rules, auto-response rules, triggers, and workflow rules. Knowing the sequence in which the rules and triggers are executed is crucial if you work as a Salesforce consultant, developer, or architect. If you are interested in Digital Marketing or Graphic Designing and want to learn these interesting courses then click on the links mentioned Digital Marketing Course and Graphic Designing course
Download these FREE Ebooks:
1. Introduction to Digital Marketing
Free Demo Classes
Register here for Free Demo Classes
In Salesforce, the term "Order of Execution" refers to a set of rules that control or explain how a record moves through various workflows and events from SAVE to COMMIT. Simply put, Salesforce carries out specific actions in a systematic manner when you save a record by using the insert, update, or upsert statement. In Salesforce, this is known as the order of execution. The DML action comes first in the execution order, followed by other involvements such as triggers, pre-built Salesforce components, workflows, various rules, etc.
2. Replace the previous values in the record fields by loading the new values from the request.
If the request originates from a regular UI edit page, Salesforce does system validation to look for the following in the record:
- Adherence to layout-specific regulations
- Values that are necessary at the layout and field definition levels
- Acceptable field formats
- Longest field possible
4. Carries out record-triggered flows that have been set up to run ahead of record saving.
5. Does everything before trigger?
6. Run the majority of system validation steps. Run user-defined validation rules and make sure that all necessary fields have a value that is not null.
7. Carries out duplicate rules.
8. Records are saved to the database but not yet committed.
9. Carries out all after triggers.
10. Carries out assignment rules.
11. Put auto-response rules into action.
12. Performs workflow operations.
13. Implements escalation policies.
14. Refresh the record if any workflow field updates exist.
15. Fires before update triggers and after update trigger one more time (and only once more), in addition to standard validations, if the record was updated using workflow field updates.
16. Executes workflow actions and processes that have been started using flow triggers.
17. Applies entitlement regulations.
18. Applies entitlement regulations.
19. Carries out record-triggered flows that have been set up to run after the record has been saved.
20. Make calculations and update the roll-up summary field in the parent record if the record has a roll-up summary field or is a part of a Cross-object process. The saving process is performed on the parent record.
21. Performs computations and changes the roll-up summary field in the grandparent record if the parent record is updated and the Grandparent record has a roll-up summary field or is included in a cross-object workflow.
22. Carries out evaluation via criteria-based sharing.
23. All DML actions are committed to the database.
24. Carries out post-commit logic, such as emailing a user.
- Every email is sent.
- Apex for asynchronous processes: @future Outgoing communications are queued in async sharing rules
- computes the index
- creates file previews
- Platform Events are published if they are set up.
According to Salesforce, there are two different sorts of triggers:
Triggers that are triggered before record values are saved to the database are known as "before triggers."
Records that are read-only are triggered using after triggers.
You can add customised changes to the Salesforce record either before or after making changes. Triggers allow for this. Apex can be triggered. Triggers are carried out either before or following certain actions:
Triggers are supported by a few top-level objects, including Account. For these, you can specify triggers. You can go to that specific object's Object Management Settings and select Triggers if you want to define a trigger.
- Records that did not initiate a delete do not set off triggers.
- Using the merge procedure, reparented child records
- significant email activity, division changes, and address revisions
- changing the data in a custom field
- When a picklist is renamed or changed
- The transfer division option is checked when you alter a user's default division.
- Price book control
- Before or after a user's account is converted to a business account, the update account trigger won't function.
- Update triggers won't function on FeedItem when the LikeCount counter rises.
The execution of a trigger is not certain when there are many triggers for the same object resulting from the same event. In this situation, Trigger Framework must be used.
Source: Safalta.comThere is much more to learn about the order of execution than just the fact that triggers execute before workflows. Apps with a better understanding of the flow will be more scalable and reliable. Enrol in a Salesforce Certification Course to learn about Salesforce and its workings.