+ Start a Discussion
shailja ranjan 8shailja ranjan 8 

order ofexecution

 I have a validation rule on the number field like number should be less than 10000. Now I have a workflow field update and it is updating with 15000. Now user has entered 12000. What will happen in this case? what will happen if we replace validation Rule with before trigger? Will the record be not saved in the both cases?
Anthony McDougaldAnthony McDougald
Hello Shailja,
Hope that your day is off to an amazing start. To answer your question, the record will not be commited to the database due to validation rules executing before workflow rules. Same would occur if you replaced the rule with a before trigger, the user's record will not be commited to the database. We've attached the order of execution below for a reference. Hope this helps and may God bless you abundantly.
Records in Salesforce are executed in a specific order. The order of execution is Initiation, System Validation, Before Triggers, System Validation plus User Validation Rules and Duplication Rules, Save with System Generated Fields (like record id), After Triggers, Assignment Rules and Auto-Response Rules, Workflows and Processes, Escalation Rules and Entitlement Rules, Roll-up Summary Fields and Criteria Sharing Rules, DML Commit, and Post Commit (like sending an email).

Best Regards,
Anthony McDougald