Question
Charles Schwab & Company Inc
Charles Schwab & Company Inc
US
Charles Schwab & Company Inc
Posted: Dec 15, 2020
Last activity: Dec 29, 2020
Last activity: 29 Dec 2020 11:47 EST
Closed
Use javascript api functions(runActivity or openURLInWindow) instead of safeURL
In the below code Iam using safeurl to run activity and return the url
Code 1:
function onClick(url,typeOfAttachment){
var eventObject = {};
var workURL = new SafeURL('ActivitClass.ActivityName');
workURL.put('url',url);
workURL.put('typeOfAttachment',typeOfAttachment);
var options = {
url: workURL.toURL(),
event: eventObject
};
pega.api.ui.actions.openURLInWindow(options);
}
Replaced the above code to use openURLInWindow JavaScript api
Code 2:
function openURLInWindowOnClick(url,typeOfAttachment){
var eventObject = {};
var options = {
activity: {
name: 'ActivityClass.ActivityName',
parameters: [
{name: "url", value:url, isProperty: true},
{name: "typeOfAttachment", value: typeOfAttachment, isProperty: true}
]
},
event: eventObject
};
pega.api.ui.actions.openURLInWindow(options);
}
Expected : Functionality of Code 2 should replicate Code 1
***Edited by Moderator: Pooja Gadige to add platform capability tag***
To see attachments, please log in.