1

Abc's Place this coming in apex. actual picklist value is => Abc's Place,

Abc's Place is coming from json from Vf page to Javascript Remoting.

It's throwing an error when I am passing to field, says that Restricted field value. how to convert ' to '?

I have used String.valueOf and escapeUnicode, but no luck.

1 Answer 1

8

' is escaped HTML Entity, just like (, &, and so on. To unescape most of them in Apex use String.unescapeHtml4() method which

Unescapes the characters in a String using HTML 4.0 entities.

For instance:

String unescapedString = 'Abc's Place & Xyz's Place'.unescapeHtml4();
// "Abc's Place & Xyz's Place"
1

You must log in to answer this question.

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