Exam PDI Topic 2 Question 64 Discussion

Actual exam question for Salesforce's PDI exam
Question #: 64
Topic #: 2
A developer has a Visualforce page and custom controller to save Account records. The developer wants to display any validation rule violations to the user.
How can the developer make sure that validation rule violations are displayed?

Suggested Answer: C Vote an answer

Validation Rule Violations:
Salesforce automatically throws exceptions for validation rule violations during DML operations.
<apex:messages>is used to display these errors to the user.
Why Not Other Options?
A: Controller attributes alone cannot handle validation messages.
B: A try/catch block does not address validation rule violations effectively.
D:Database.upsert()method is not related to validation error handling.
References:Apex Messages:https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages
/pages_compref_messages.htm

by Yves at Jun 28, 2026, 10:09 AM

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
Nick name: Submit Cancel
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.

0
0
0
10