3

Ist there any way to modify the bold title of ApexPages.Message when created via code? enter image description here

I know that you can alter this when you construct the message via apex:pageMessage

1
  • 1
    Find out how you can identify that message (id of html element or does it use a certain CSS class) and then override the styling in your local CSS.
    – FrankZ
    Jul 9 '14 at 12:45
3

You can use the third (less common) form of constructing a message:

new ApexPages.Message(ApexPages.severity, summary, detail);

Also, you'll need to make sure you're showing summary and detail information on the apex:pageMessages element (showDetail should be true).

3

If you are showing custom error message from controller on page using ApexPages.Message then you can use html bold tag i.e. in the message like this

new ApexPages.Message(ApexPages.Severity,'<b>Error: Invalid Input.</b>');

And on the page where you use tag you can use attribute "escape" like this

<apex:pageMessages escape="false"/>

I hope this answers your question.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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