PDI · Question #194
A developer created a trigger on a custom object. This custom object also has some dependent pick lists. According to the order of execution rules, which step happens first?
The correct answer is D. JavaScript validation is run In the browser. In the Salesforce order of execution, client-side JavaScript validation (e.g., for dependent picklists) is the very first step before any server-side processing begins for a record save operation.
Question
A developer created a trigger on a custom object. This custom object also has some dependent pick lists. According to the order of execution rules, which step happens first?
Options
- ASystem validation is run for maximum field lengths.
- BThe original record is loaded from the database.
- COld values are overwritten with the new record values,
- DJavaScript validation is run In the browser.
How the community answered
(44 responses)- B5% (2)
- C2% (1)
- D93% (41)
Why each option
In the Salesforce order of execution, client-side JavaScript validation (e.g., for dependent picklists) is the very first step before any server-side processing begins for a record save operation.
System validation for maximum field lengths is a server-side step that occurs later in the order of execution, after client-side validation and before `before trigger` execution.
Loading the original record from the database occurs on the server-side, after client-side validation and after the new record values have been submitted to the server.
Overwriting old values with new record values is part of the server-side processing, specifically after the original record has been loaded and before or during the `before trigger` phase.
The Salesforce order of execution starts with client-side validation, where any JavaScript validation rules, such as those governing dependent picklists, execute in the browser before the record data is submitted to the server for processing.
Concept tested: Salesforce order of execution (client-side validation)
Source: https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_triggers_order_of_execution.htm
Topics
Community Discussion
No community discussion yet for this question.