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

Exam Certified Platform Developer II All Questions

View all questions & answers for the Certified Platform Developer II exam

Exam Certified Platform Developer II topic 1 question 26 discussion

Actual exam question from Salesforce's Certified Platform Developer II
Question #: 26
Topic #: 1
[All Certified Platform Developer II Questions]

A custom Visualforce controller calls the ApexPages.addMessage() method, but no messages are rendering on the page.
Which component should be added to the Visualforce page to display the message?

  • A. <apex:message for="info"/>
  • B. <apex:facet name="messages" />
  • C. <apex:pageMessage severity="info" />
  • D. <apex:pageMessages />
Show Suggested Answer Hide Answer
Suggested Answer: D 🗳️

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
SalesforceMark
Highly Voted 2 years, 7 months ago
it is D. C is only a SINGLE message
upvoted 11 times
...
singhkar
Highly Voted 3 years, 5 months ago
C is the correct ans since severity is the required tag refer the below reference https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_compref_pageMessage.htm
upvoted 5 times
...
Keiyo
Most Recent 1 year, 2 months ago
The <apex:pageMessages /> component is used to display all messages that have been added to the page using ApexPages.addMessage(). It is a common way to render messages on a Visualforce page.
upvoted 1 times
...
Sasi7
1 year, 8 months ago
Correct answer is D. We should add <apex:pageMessages /> component to the Visualforce page to display the message. This component collects and displays all messages with appropriate styling based on their severity (info, warning, error, etc.).
upvoted 2 times
...
rufusroffie
1 year, 8 months ago
it is D because you can only use ApexPages.addMessage() to add to <apex:pageMessages/> C is only single message render the markup value, you cant run addMessage to add more message to it
upvoted 3 times
...
SpiritualBeing
2 years, 3 months ago
C is the correct answer
upvoted 1 times
...
AjayMehta
2 years, 7 months ago
D is correct https://developer.salesforce.com/docs/atlas.en-us.234.0.pages.meta/pages/pages_compref_pageMessages.htm
upvoted 3 times
...
Sri_Vathsa
2 years, 11 months ago
D is correct
upvoted 2 times
...
NPW89
3 years ago
D is correct https://www.sfdcpoint.com/salesforce/apexpagemessage-and-apexpagemessages-salesforce/
upvoted 3 times
...
shatrughna
3 years ago
Verified C is the correct answer
upvoted 2 times
...
Pratibhadx
3 years, 1 month ago
C is the correct one.
upvoted 2 times
...
AnhTH
3 years, 1 month ago
I think D is correct answer. apex:pageMessage only display custom message. And with severity is "info", it doesn't display error message.
upvoted 2 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 ...