3

So I have a validation rule, which has a double quote(") in its error message. The location of the error message is at field level.

Suppose for example, the error message is:

You need to enter a valid "Account Name"

This message gets displayed as:

You need to enter a valid "Account Name"

I am aware that, keeping escape= false in pagemessages would display the double quote instead of " in visualforce page.

The problem I am facing is on the field level error messages. Is there anything to display the field level messages with proper double quotes(without escaping)?

2
  • Is this in a visualforce page where you have inputField? Commented Jun 7, 2018 at 6:08
  • yes its in VF page Commented Jun 7, 2018 at 6:09

1 Answer 1

2

This is a known issue. You might need to use single quotes or eliminate the quotes altogether. Alternatively, use pagemessages with escape=false as you already mentioned.

2
  • Thanks for the helpful information. Was thinking of trying this through javaScript as the last resort, not sure how good practice is that. Commented Jun 7, 2018 at 6:17
  • 1
    It's definitely an option. If the aim is to provide a better user experience, then go for it. I'd weigh the value vs the effort first though Commented Jun 7, 2018 at 6:20

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .