Directory Image
This website uses cookies to improve user experience. By using our website you consent to all cookies in accordance with our Privacy Policy.

Salesforce Order of Execution

Author: Iamakhila Priya
by Iamakhila Priya
Posted: Dec 02, 2019

Salesforce has a set of rules made on objects and fields. For instance, you can define different rules like validation, workflow, process builder, flows, assignment, hike, auto reply rules etc.

Either you may be an administrator, developer, consultant or architect, it is necessary for you to understand the order of executing the rules. Whenever you save information with an insert, update statement, salesforce online training executes the below events in order.

If the record includes any dependent checklist sections, then the browser compiles JavaScript confirmation before the execution of these action on the server. The confirmation limits every dependent checklist field to its available details. There are no confirmations that occur on the client side.

Execution Order in Salesforce:

  1. First, the database is filled with Original record or starts the record for an insert or update statement.
  2. System validation rules:

Updates the new record field data from the request and replaces the old data.

When an invitation came from a standard UI modify page, then Salesforce executes system confirmation to check the report for:

  • Conformation with layout concerned rules

  • Necessary values at the interface and field definition level

  • Approved field patterns

  • Highest field size

When the invitation comes from other resources, like a SOAP API call or Apex application, Salesforce checks foreign keys only. Salesforce checks if any custom external keys don’t point to the object itself, before completing a trigger action.

When multiline objects like the quote and opportunity line objects are made, Salesforce executes user-defined confirmation guidelines.

  1. Compiles everything before triggers.
  2. Custom validation rules:

Except for enforcement of layout specific rules, Again salesforce training executes many system validation steps, like checking all necessary fields that have no-zero data, and any user defined validation rules.

5. Compiles Duplicate Rules:

If the copied rule finds the record as a copied one and uses the block activity, the record won’t save and the next steps like triggers and work process guidelines are not taken.

  1. Stores the data in the database, but it will not confirm it yet.
  2. Runs all next to triggers
  3. Runs assignment rules
  4. Runs auto-reply rules
  5. Runs workflow rules
  6. If we have any work plan updates, the record is updated again
  7. Once again, the front and back triggers are compiled, when the record is refreshed with updated working rules. But, the thing is custom confirmation, copy and escalation rules are not compiled once again.
  8. Executing flows and processes are initiated through flow trigger work flow operations. When a process or flow runs a DML operation, then the related record is saved.
  9. Runs escalation rules
  10. Runs act rules
  11. When the record consists of execution review section or is included in any cross-object work process, performs estimations and updates the execution review field in the main record. After that parent record is saved.
  12. When the parent record is refreshed, and a grandparent record consists of execution review section or is included in a cross-object work process, makes estimations and updates the execution review field in the grandparent record. After that, Grandparent record is saved.
  13. Runs sharing testing based on some plan.
  14. Confirms all DML functions to the database.
  15. Runs after confirmation logics like sending the email.

Important Points:

Pay attention to these things when working with triggers:

  • When there are multiple triggers to the same object, the execution order is not sure because of the same event. Suppose if there are two frontend insert triggers for the case, and a new case record is kept that starts the two triggers, then the order for these trigger start is not confirmed.

  • When a DML call is made along with low success allowed, if the first attempt leads to faults for some records, then more than one trial can be made to save the successful records.

  • If your company uses contacts to different accounts, when you insert a non-private contact or change a contact’s main account, an Account Contact Relation is created and its confirmation rules, database updation, and triggers are executed after saving the contact to the database.

In this article, I have given you about, what is the order of execution in Salesforce. Follow these steps for proper execution.

About the Author

Msbi represents Microsoft Business Intelligence. Msbi (Microsoft Business Intelligence) is one of the Etl apparatus identified with the database side.

Rate this Article
Leave a Comment
Author Thumbnail
I Agree:
Comment 
Pictures
Author: Iamakhila Priya

Iamakhila Priya

Member since: Jul 15, 2019
Published articles: 13

Related Articles