Forum Stats

  • 3,838,691 Users
  • 2,262,394 Discussions
  • 7,900,734 Comments

Discussions

Escape APEX Substitution Strings

User_WM015
User_WM015 Member Posts: 1 Green Ribbon
edited Apr 11, 2022 1:15PM in APEX Discussions

What is the best way to escape APEX Substitution Strings, that they didn't get replaced during the serverside processing?

I tried to setup a Template for apex.util.applyTemplate inside the per page Javascript areas. The problem is that all placeholders ("&VARNAME.") get replaced serverside and therefore can't get replaced by apex.util.applyTemplate with the current clientside value.

So how can I tell APEX to not replace them serverside?

I have found a dirty solution to this problem by inserting a dummy substitution inside the real substitution. Like this "&&_.VARNAME.". APEX then just replace the inner substitution with an empty string and there the real substitution is correct clientside. But it is a dirty solution because whenever the dummy substitution gets set with a value the real substitution gets corrupted.