Welcome to ExamTopics
ExamTopics Logo
- Expert Verified, Online, Free.
exam questions

Exam CRT-450 All Questions

View all questions & answers for the CRT-450 exam

Exam CRT-450 topic 1 question 54 discussion

Actual exam question from Salesforce's CRT-450
Question #: 54
Topic #: 1
[All CRT-450 Questions]

A lead object has a custom field Prior_Email__c. The following trigger is intended to copy the current Email into the Prior_Email__c field any time the Email field is changed:

Which type of exception will this trigger cause?

  • A. A null reference exception
  • B. A compile time exception
  • C. A DML exception
  • D. A limit exception when doing a bulk update
Show Suggested Answer Hide Answer
Suggested Answer: C 🗳️

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
venkatasunilr
Highly Voted 4 years, 1 month ago
The correct answer is "C". In before triger you can modify the records without explicitly calling a DML insert or update operation.
upvoted 13 times
...
ryuu
Highly Voted 3 years, 4 months ago
There is typo in second last line ‘trigger.old,ap’. If this is deliberately done then it will have compile time exception
upvoted 6 times
...
irina_735
Most Recent 1 year, 2 months ago
Selected Answer: C
If the typo error was unintentional, then C is correct: System.SObjectException: DML statement cannot operate on trigger.new or trigger.old
upvoted 1 times
...
1vanTT
1 year, 6 months ago
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.
upvoted 1 times
...
Infoash
4 years, 1 month ago
The right answer is D. A limit exception when doing a bulk update
upvoted 1 times
...
am1
4 years, 6 months ago
c, since DML stmt is inside for loop and can cause limit exception.
upvoted 4 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...