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
stunaitestunaite 

Line Breaks in Validation Rule Error Message

Hi,

 

I have a visualforce page with an <apex:messages/> tag. I have created a validation rule with an error message. To have a similar behavior with standard pages I need to break my validation rule error message in diferent lines so the error message appears in 3 different lines.

 

Standard Behavior:

 

                                                                     

                                                                               Error: Invalid Data. 

                                                Review all error messages below to correct your data. 

                                                                   Pair (Year/Product) already exists!

 

What I have now:

 

Error: Invalid Data. Review all error messages below to correct your data. Pair (Year/Product) already exists!

 

I tried to split the error message text in 3 different lines in my validation rule error message box:

 

Error message box in validation rule page:

 

Error: Invalid Data. 

Review all error messages below to correct your data.

Pair (Year/Product) already exists!

 

 

It had no effect. What characters should I include in error message to cause a real line break?

 

Thanks in advance

Shashikant SharmaShashikant Sharma

Please try

escape="false" in  like

<apex:messages escape="false"/> but I doubt this will work from validation rule. But if you catch the exception and show  a Apex Message with line break they will appear for sure.

stunaitestunaite

Hi! Thanks for your answer... but

 

Standard behavior is simillar with <apex:messages and not with <apex:pagemessages. Unfortunately, <apex:messages doesn't have the attribute escape... 

 

 

Any other idea will be welcome.

 

 

Achilles21Achilles21


Hi,

 

I am facing the same issue ... have you gotten a solution to this yet ?