Question
TCSL
IN
Last activity: 28 Aug 2018 9:35 EDT
I want to set Clipboard Property to a Variable in js,which is not working
Hi Team.
Issue:Need to set a clipboard page property to variable in js.Given below in js.
var testvar = '<%= tools.findPage("pxRequestor").getIfPresent(".pxReqLocale").getStringValue(); %>';
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Accepted Solution
TCSL
IN
Hi Team,
Thanks for resolving SR.
This is resolved by variables are set into Pega Rule "UserWorkForm" by customizing it.
Regards
Aswana
Pegasystems Inc.
US
Aswana,
Your image did not show up in your post, perhaps you could re-upload or write out the alert output. Also please let us know what version of Pega you are using as this could affect the answer.
I would like to know why you are trying to set a clipboard value using js? Assuming a recent version of Pega there are probably better ways to accomplish what you are trying to do that work more within the guardrails.
Sincerely,
Cecil Howell
Senior Technical Instructor, Pega
TCSL
IN
Hi Cecil,
I need to implement GTm Functionality in my application.
I called the function in a text file and called from Harness.But in the analytics graph i need set the page views with page names.For that i need to set the variable before calling this function.But i cant set var(ex.Locale).
In alert the syntax itself throwing as alert.
Hope this helps.
Regards
Aswana
Pegasystems Inc.
US
Can you try setting to a "ClipboardProperty" instead of "var", i mean in Scriptlet first. For example,
ClipboardProperty value= tools.findPage("WorkPage").getProperty("test");
Then setting it to var. First check whether value is not empty. You can use oLog.infoForced("Value="+value);
TCSL
IN
Hi Rachit,
I am getting below syntax error on this.
Vodafone
IN
Hello Aswana,
I have gone through the issue, I found there is an extra ';' which is an obstucle in declaring the value to variable.
Use the below, this will work fine.
var testvar = '<%= tools.findPage("pxRequestor").getIfPresent(".pxReqLocale").getStringValue() %>';
Reason: ';' is take to next line.
TCSL
IN
Hi Naveen,
throwing same error.
CollabPartnerz
IN
Hi Aswana,
Please follow below link.
https://collaborate.pega.com/question/copy-property-value-clipboard-variable-using-javascript
TCSL
IN
Hi Gaya,
I have seen this link from PDN,But which was not working.
Regards
Aswana
TCSL
IN
Hi Team,
Waiting for an Update.
Regards
Aswana
TCSL
IN
Hi Marissa,
Waiting for an update on this.
Regards
Aswana
Pegasystems Inc.
US
Try using the code in an html rule referenced in your harness, such as a non-autogenerated section or control.
I tried a non-autogenerated section and it displayed properly with this code.
<script>
var testvar = '<%= tools.findPage("pxRequestor").getIfPresent(".pxReqLocale").getStringValue() %>';
alert(testvar);
</script>
-
Subashini Ananthakumar GOKUL PRASATH S VIGNESH L
TCSL
IN
Hi Carissa,
Hi Carissa,
TCSL
IN
Hi Marissa,
Hi Marissa,
Pegasystems Inc.
US
Hi Aswana!
I see that you're working on this via your SR. Please update this thread with your resolution once it's met.
Thank you!
Accepted Solution
TCSL
IN
Hi Team,
Thanks for resolving SR.
This is resolved by variables are set into Pega Rule "UserWorkForm" by customizing it.
Regards
Aswana