1. Before triggers:
If we update child records in before triggers then parent record automatically update.
2. Validation rules:
If validation matches the criteria then error will populate in same page.
Runs most system validation steps again, such as verifying that all required fields have a non-null value, and runs any user-defined validation rules. The only system validation that Salesforce does not run a second time (when the request comes from a standard UI edit page) is the enforcement of layout-specific rules.
*Note: Saves the record to the database, but does not commit yet.
3. After Triggers:
4. Assignment Rules:
5. Auto Response Rules:
6. Workflow Rules:
If there are workflow field updates, updates the record again.
7. Escalation Rules:
If the record contains a roll-up summary field or is part of a cross-object workflow, performs calculations and updates the roll-up summary field in the parent record. Parent record goes through save procedure.
If the parent record is updated, and a grand-parent record contains a roll-up summary field or is part of a cross-object workflow, performs calculations and updates the roll-up summary field in the parent record. Grand-parent record goes through save procedure.
Executes Criteria Based Sharing evaluation.
Commits all DML operations to the database.
8.Executes post-commit logic, such as sending emails
simple steps:
==============
Order of Events
If we update child records in before triggers then parent record automatically update.
2. Validation rules:
If validation matches the criteria then error will populate in same page.
Runs most system validation steps again, such as verifying that all required fields have a non-null value, and runs any user-defined validation rules. The only system validation that Salesforce does not run a second time (when the request comes from a standard UI edit page) is the enforcement of layout-specific rules.
*Note: Saves the record to the database, but does not commit yet.
3. After Triggers:
4. Assignment Rules:
5. Auto Response Rules:
6. Workflow Rules:
If there are workflow field updates, updates the record again.
7. Escalation Rules:
If the record contains a roll-up summary field or is part of a cross-object workflow, performs calculations and updates the roll-up summary field in the parent record. Parent record goes through save procedure.
If the parent record is updated, and a grand-parent record contains a roll-up summary field or is part of a cross-object workflow, performs calculations and updates the roll-up summary field in the parent record. Grand-parent record goes through save procedure.
Executes Criteria Based Sharing evaluation.
Commits all DML operations to the database.
8.Executes post-commit logic, such as sending emails
simple steps:
==============
Order of Events
- Original record is loaded or new record is initialized
- Fields values are loaded into sObjects
- System validations rules are executed:
- Before triggers are executed
- System validations rules are run again and custom validation rules are checked.
- Duplicate rules are executed
- Record is saved but not committed
- After triggers are executed
- Assignment rules are executed
- Auto-response rules are executed
- Workflow rules are executed
- Before triggers,system validation rules and after triggers are executed due to workflow field updates
- Processes are executed
- Escalation rules are executed
- Entitlement rules are executed
- Rull-up summary fields and cross-object formula fields are updated
- Updated parent and grand parent records are saved
- Criteria based sharing rules are evaluated
- DML operations are committed to the database
- Post-commit logic is executed
No comments:
Post a Comment