function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Jan Kopejtko 2Jan Kopejtko 2 

Which fires first - trigger, process or validation rule?

Hey guys,

could anybody tell me or send me a link to documentation where it says what fires first?

In my org I have Apex triggers, processes, validation rules, workflow rules. What does fire first and what last? Is there some kind of system?

Thank you
Best Answer chosen by Jan Kopejtko 2
GovindarajGovindaraj
Hi Jan,

Below link will be helpful to understand execution order,
https://sfdcpanther.wordpress.com/2017/10/11/triggers-and-order-of-execution-salesforce/

In general, the execution order is like below,
1. System validation
2. Before triggers
3. Custom validation
4. Duplicate rules
5. Data get commited but not saved
6. After triggers
7. Assignment rules
8. Auto response rules
9. Workflow rules, if there is any field update then Before and After triggers get executed again
10. Process builder
........
15. Commits the data into DB
16. Post commit logic

Thanks,
Govindaraj.S