Preparing Practice Exam…
Please wait a moment while the system generates the exam questions, answers, and study session.
Please wait a moment while the system generates the exam questions, answers, and study session.
Salesforce Certified Platform Developer I (PDI) · Salesforce
Select one answer.
Written by other learners. Comments can disagree with the marked answer — check the official documentation when in doubt.
If the typo error was unintentional, then C is correct: System.SObjectException: DML statement cannot operate on trigger.new or trigger.old
C is correct. You don't make a DML statement in a before trigger as it gets implicitly updated after the trigger ends. The before trigger runs before the DML operation. https://www.sfdcpoint.com/salesforce/apex-trigger-in-salesforce/ Although there are many typos in the example which would prevent the code from saving / running.
There is typo in second last line ‘trigger.old,ap’. If this is deliberately done then it will have compile time exception