Salesforce Certified Platform Developer II — Question 16
Choose the correct definition for <apex:messages>.
Answer options
- A. Standard Salesforce formatting, throws a specific message on a page
- B. Standard Salesforce formatting, shows all errors that occur on page. Can add more messages through the "ApexPages.addMessage" function
- C. A single message, without formatting, that can be associated with a specific component on the page
- D. No formatting; displays all errors on a page
Correct answer: B
Explanation
<apex:messages> is designed to display all error messages that occur within the page, and it utilizes standard Salesforce formatting. Option A is incorrect because it does not mention error display; C is wrong as it refers to a single message, while D lacks the mention of a structured way to show errors.