function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
SkyBlue2007SkyBlue2007 

How to insert line with addMessage Method.

Hi everyone,

 

I'd like to insert line with addMessage Method.

For example, the below code doesn't work.

 

ApexPages.addMessage(new ApexPages.Message( ApexPages.severity.ERROR,'aaa','bbb <br/> ccc'))

Please let me know if you have best practice.

 

Thanks,

Seiji

michaelforcemichaelforce

I think that '\n' works... although if you are using the apex messages component it won't actually show the carriage return, it will show as a space.

SkyBlue2007SkyBlue2007

Hi,

 

Thank you for your reply.

You're right, '\n' shows the carriage return because I'm using the 'apex:pageMessages'.

 

Thanks,

Seiji