PDI practice question 24 of 30
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?
Full set: 201 questionsAccording to the Salesforce server-side order of execution for a save operation (specifically an update), the very first step is to load the original record from the database. This action makes the record's pre-modification values available in memory (e.g., for Trigger.old). This step must occur before any validations are run or any new values from the user's request are processed, ensuring a baseline for comparison and logic execution throughout the transaction.
B. System validation is run for maximum field lengths. This occurs after the original record is loaded and the new values from the request are loaded into the sObject in memory.
C. Old values are overwritten with the new record values. This happens in memory after the original record is loaded. The database commit, which permanently overwrites the values, occurs much later.
D. JavaScript validation is run in the browser. This is a client-side action that happens before the data is submitted to the server and is not part of the server-side transaction's order of execution.
1. Apex Developer Guide, Salesforce Documentation: In the "Triggers and Order of Execution" section, the documented sequence for an update operation begins with:
"1. Loads the original record from the database..."
"2. Loads the new record field values from the request and overwrites the old values."
"3. Executes system validation steps...verifying that all required fields have a non-null value, and runs any user-defined validation rules."
(Reference: Apex Developer Guide, Chapter: "Triggers", Section: "Triggers and Order of Execution")
2. Trailhead by Salesforce: The "Apex Triggers" module reinforces this sequence.
"When a record is saved, the first thing Salesforce does is load the original record. Next, it loads the new values from the user. Only after that does it start running system validation."
(Reference: Trailhead, Module: "Apex Triggers", Unit: "Trigger and Order of Execution")
Keep practicing
Take the free PDI practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other PDI practice questions
- Question 1What can be used to override the Account's standard Edit button for Lightning Experience?
- Question 4Universal Containers (UC) wants to lower its shipping cost while making the shipping proc…
- Question 5A developer has an integer variable called maxAttempts. The developer needs to ensure tha…
- Question 7Universal Containers wants to back up all of the data and attachments in its Salesforce o…
- Question 8Universal Containers hires a developer to build a custom search page to help users find t…
- Question 9As part of new feature development, a developer is asked to build a responsive applicatio…
