50 likes | 69 Views
The order of execution in Salesforce is based on the process flow. The process flow determines how data should be routed through the system. Check out this presentation by the Blueflame Labs, the Salesforce Implementations partners, on the order of execution in Salesforce and debug logs. Read now! https://www.theblueflamelabs.com/order-of-execution-in-salesforce/
E N D
INTRODUCTION • Salesforce provides a bunch of rules that can be defined on objects and fields. • As an example, you can define Validation rules, Workflow rules, Process Builder, Flows, etc. • You need to understand the order of execution in which these rules and triggers are executed, whether you are an Administrator, Consultant, Developer, or Architect.
EVENTS TO SAVE A RECORD • Salesforce conducts the following events in order when you save a record with an insert, update, or upsert statement. • On the server, Salesforce: • Initializes the record for an upset statement by loading the original record from the database. • Overwrites the old values with the new record field values loaded from the request. • Runs record-triggered flows that are set to execute before the record is saved. • Execute everything before the triggers. • Verifies all necessary fields.
EVENTS TO SAVE A RECORD • Stores the record in the database, but does not yet commit it. • All after-triggers are executed. • Follows the rules of the assignment. • Enables auto-response rules to be executed. • Follows the workflow rules.
EVENTS TO SAVE A RECORD • Updates the record once more. • The system validations are re-run. Validation, flow, duplication, process, and escalation rules are not re-run. • Regardless of the record operation (insert or update), executes one more time before and after update triggers (and only one more time). • Check complete blog by Blueflame Labs, the salesforce implementation partners • https://www.theblueflamelabs.com/order-of-execution-in-salesforce/