Salesforce
PDII · Question #79
A developer wants to create a Visualforce page that allows a user to search for a given account by Name. If the account is found, the account details should be populated on screen. If no account is…
The correct answer is B. Use the ApexPages.addMessage() method to add the error message C. Use the <apex:pageMessages> tag to display the error message. See the full explanation below for the reasoning.
Question
A developer wants to create a Visualforce page that allows a user to search for a given account by Name. If the account is found, the account details should be populated on screen. If no account is found, an error message should be displayed to the user. How can this be accomplished? (Choose two.)
Options
- AUse the (apex: information) tag to display the error message
- BUse the ApexPages.addMessage() method to add the error message
- CUse the apex:pageMessages tag to display the error message
- DUse the account.addError() method to add the error message
How the community answered
(27 responses)- A7% (2)
- B81% (22)
- D11% (3)
Community Discussion
No community discussion yet for this question.