Question

Activity not being called from JavaScript on initial login

Hi All,

I am calling an activity from JavaScript using the below code -

oSafeUrl = new SafeURL("ClassName.ActivityName");
oSafeUrl.put("Param",value);

var request = pega.util.Connect.asyncRequest('GET',oSafeUrl.toURL());

But by using this, the activity is not being called during the initial log in of the requestor session.
The JavaScript was placed in multiple locations and tried starting with Scripts and Styles tab of the Harness Rule, included in HTML fragments in the pyPortalHeader section, included non-auto generated section in the pyPortalHeader section, etc., but none have worked. Not just activities but even Data Transforms could not be called on initial load.
Once the requestor session is completely created, then the activity is called successfully on all subsequent calls.
Any help on this will be much appreciated. Thanks in advance.

Thanks,

Charan

Comments

Keep up to date on this post and subscribe to comments

December 9, 2019 - 8:25am

Hello, 

Would it be easiest to call this activity using a placeholder during initial login instead of using JavaScript maybe.

December 9, 2019 - 8:48am
Response to MarcLasserre_GCS

Hey Marc,

The reason we have to go with JavaScript is because we have to capture the Redirect Query parameter and pass it as parameter to the activity which determines which screen to load. 

December 9, 2019 - 9:06am
Response to Sai Charan

December 9, 2019 - 9:41am
Response to MarcLasserre_GCS

The mentioned post hasn't got any solutions that I haven't already tried. 
Yes, it is the same across all browsers.

December 9, 2019 - 10:08am
Response to Sai Charan

 

I've seen the following in the past working correctly

var oSafeUrl = new SafeURL("@baseclass.ActivityName");

var request = pega.u.d.asyncRequest('GET',oSafeUrl);

December 11, 2019 - 6:08am
Response to MarcLasserre_GCS

Hey Marc, I have tried the mentioned approach but it still doesn't seem to call the activity neither during initial launch nor during subsequent calls.