Thank you for your reply. I believe the issue is that, the function I have called, expects two strings. And I do not want to replace one string, with another string, but rather the escape sequence characters. Pega is not allowing me to save the change at all. As it is expecting another string:
Could you please post the solution details here? You discussed offline and the solution details are not here. it might help others.
We have similar issue in Filed Value rule, we have a requirement to high light some string in double quotes. When we save the rule it is converting into HTML escape character sequence and I see while saving the rule itself conversion happened.
Couldn’t fully understand your problem. But we had a similar issue in which field values which required a single quote was getting displayed as escape characters which was resolved using this hotfix. Hfix-22647. You might want to try that out?
My first thought is, what is escaping them to begin with? Is the browser escaping the data on input (an HTTP debugger like Fiddler should help you see that)? Perhaps that's where you want to do the substitution. Definitely calling replaceAll() is going to require you to use the exact string (in quotes, otherwise it will be treated as a reference). You've got the string "@" and "&#64;" above, so clearly trying to replace one string if the clipboard has the other will result in problems. Of course, "&#64;" is "@" with the '&' replaced with the HTML code equivalent. That is one of the reasons I'm thinking you would be better off focusing on why your strings are having HTML code substitutions. The clipboard shouldn't be doing that.
Thanks for shedding light on the limitation with the Function replaceAll. I now understand why it will not work.
I thought the issue was that, the characters ARE NOT being escaped. So, that when the "@" for example is given, it is displayed as its escape character sequence of "&#64;". And that it is the codes job to see the @ sign, and replace it with the escape sequence, so it displays correctly.
But, are you saying that the @ should display normally? And that something extra is happening, in replacing it with the escape sequence??
Also this is a Pega Activity, which puzzles me that this issue would be occurring with it.