Skip to main content

This content has been archived and is no longer being updated. Links may not function; however, this content may be relevant to outdated versions of the product.

Support Article

Unable to set Clipboard page property to variable in external JS

SA-63644

Summary



Unable to set a Clipboard page property to variable in external JavaScript file.


Error Messages



Not Applicable.


Steps to Reproduce

  1. Create a Text (JS) file and code the statement
  2. Add the Pega tag inside the JS file and assign it to a variable
  3. Run the JS file. The Pega reference tag is not resolved


Root Cause



Pega JavaServer Pages (JSP) tag is not recognized in the external JS file. Thus, the user was unable to get the Clipboard page value using the Pega tag inside JS file. 


Resolution

Perform the following local-change: 
  1. Inside a UserWorkForm create a variable and get the value from the Clipboard:
    <script>
       var testvar = '<%= tools.findPage("pxRequestor").getIfPresent(".pxReqLocale").getStringValue(); %>';
    </script>

     
  2. Refer the above testVar in the JS file

 
Suggest Edit

Published January 4, 2019 - Updated October 8, 2020

Did you find this content helpful? Yes No

Have a question? Get answers now.

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

We'd prefer it if you saw us at our best.

Pega Community has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice
Contact us