Support Article

Special symbols replace by ASCII code in Page-Messages

SA-36580

Summary



When a Field Value rule with a parameter for a clipboard property value that contains special characters is used in a Page Message, the ASCII code of the special characters is presented unexpectedly.


Error Messages



Not Applicable


Steps to Reproduce

  1. Create Field Value rule (such as StopListValidationHeader ) with category Message Label(that is, pyMessageLabel) and use {1} in the Field value content to use parameters.
  2. In post-processing activity use Property-Set step to set Param with getLocalizedText value like: @Utilities.getLocalizedText("StopListValidationHeader\t" + "\t" + .FullName, "pyMessageLabel", tools) Where Local.Message contains string with special symbol.
  3. Use Page-Set-Messages at Work Page with Param populated in above step.
  4. Observe messages at Work Page are shown with all special symbols replaced with ASCII code.

Root Cause



The API, that is, @Utilities.getLocalizedText) will only decode if the message is encoded.

That is, one can decode a message which is not encoded and issue does not occur.

Resolution



Use one of the following approaches to resolve the issue:

Local Change Approach 1:

1. 'Save As' @baseclass.pyLabel property into application ruleset.
2. Make UI Control as blank and save.

Local Change Approach 2 :

1. After getting the localized text message, use following public API to decode the encoded message:
com.pega.pegarules.pub.util.StringUtils.restoreFilteredString("{rcsf}"+errorMessage);


Published April 16, 2017 - Updated June 15, 2017

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.