pega.util.Connect.asyncRequest is throwing 500 when trying to execute activity

Hi,

In my js file i have used below
var safeURL= new SafeURL(“ClassName.ActivityName”);

pega.util.Connect.asyncRequest(“GET”,safeURL.toURL(),{
success: function(response){
debugger;
console.log(JSON.stringify(response));
},
failure:function(response){
debugger;
console.log(“Failed to call activity”);
}
});

Activity has security settings as to allow invocation from browser with the right Privilege Class and Privilege, yet this function is throwing 500 error.
Can someone please help on this.

@sumabhanul It looks like you are trying to call an activity from JavaScript and encountering a 500 error despite having the correct security settings. Here is a sample code snippet that might help you resolve the issue: ```javascript var oSafeUrl new SafeURL(

:warning: This is a GenAI-powered tool. All generated answers require validation against the provided references.

How to run an activity through JavaScript.

Unable to set clipboard property value from javascript variable

If you still need heolp please log a support ticket via the MSP and provide the INC id here.