Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I was wondering if there's a way to display a link in an ApexPages.Message. There's nothing mentioned in the documentation about it, so I simply did a :

ApexPages.Message(ApexPages.Severity.CONFIRM, '<a href="/">test</a>');

It seems like the special characters are transformed to their html entity, making the link unusable.

Any known workaround?

share|improve this question
up vote 17 down vote accepted

You may need to set escape parameter to false in your VF page.

<apex:pageMessages escape="false"/> 
share|improve this answer
Super cool, never heard of that attribute. Working surprisingly well :D! Thanks @richard-n – jpmonette Feb 25 '13 at 17:56
Note that this means any HTML included in your ApexPages.Message objects will be rendered as HTML in the page, and if you have to undergo security review you may be asked to justify this choice. – ca_peterson Feb 26 '13 at 1:44

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.