Run Script on button click is not working from end user portals in Pega 8.7.3

we have configured run script on button click in which we are using pega ootb function “pega.ui.composer.formfactor.copyToClipboard” which is used to copy content based on a testid. It is working when we are testing from dev studio having SysAdm4 but is is not working from end user who are not having this access.

Can you suggest any solution for this

@MandeepRawat

If you are invoking activity in your script, can you please try replacing.

var oSafeUrl=new SafeURL(youractivityName) with below step and see if its working

var oSafeUrl = new SafeURL(“<%tools.appendString(pega_rules_utilities.pzEncryptURLActionString(tools, “Thread”, “pyActivity=youractivityName”));%>”)

Note: In Pega 8 it is good practice to replace the run script with run activity on click of event.

Thanks,

Lokanath

@LOKANATH somehow pega was looking for Privileges - pxTestID, we have added this to our Access Roles and now it is working good.

@MandeepRawat Can you please send SS on how to pass the values to the values to the function “pega.ui.composer.formfactor.copyToClipboard”.