Support Article
JavaScript function does not work after upgrade to Pega 8.2.1
SA-89070
Summary
A custom script is implemented such that it is executed by pressing a button in a section. This script is added as an embedded section (non-auto generated HTML section) on the section with the button. The goal of this script is to display a popup message (alert) window.
However, post upgrade to Pega Platform 8.2.1, the 'getLocalizedValue' function in the script does not work. This function localizes the given property to the Operator locale.
Error Messages
Not Applicable
Steps to Reproduce
- Upgrade to Pega Platform 8.2.1.
- Launch the application.
- Click on the button to initiate the custom script.
Root Cause
Due to the Customer Service (CS) archetecture (several iFrames), some functions are not available in each iFrame. In this case, the getLocalizedValue funciton is unavailable
Resolution
Perform the following local-change:
Refer to the top window element which can access the Pega API always.
In this scenario, the correct function is, window.top.pega.cpm.localization.getLocalizedValue.
Published April 2, 2020 - Updated December 2, 2021
Have a question? Get answers now.
Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.