Exam PDI Topic 3 Question 202 Discussion

Actual exam question for Salesforce's PDI exam
Question #: 202
Topic #: 3
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.
* Apex Messages: https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages
/pages_compref_messages.htm
References:

by Rachel at Sep 22, 2025, 11:09 PM

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.

Contact Us

If you have any question please leave me your email address, we will reply and send email to you in 12 hours.

Our Working Time: ( GMT 0:00-15:00 ) From Monday to Saturday

Support: Contact now 

日本語 Deutsch 繁体中文 한국어