ServiceNow Create a general request button on agent workspace to take users to a general request item
script:
function onClick() {
var params = {};
params.sysparm_parent_table = "interaction";
params.sysparm_parent_sys_id = g_form.getUniqueValue();
//params.sysparm_software_requirements = current.short_descritpion;
var paramsJSON = JSON.stringify(params);
var request = new GlideAjax('RequestLinkSessionManager');
request.addParam('sysparm_name', 'setComponentSessionValueMapJSON');
request.addParam('workspace_request_session_data', paramsJSON);
request.getXMLAnswer(function(answer){
onSubmitAfterSessionPut(params);
});
}
function onSubmitAfterSessionPut(params) {
var result = g_form.submit('sysverb_ws_save');
if (!result) { // failed form submission
return;
}
result.then(function() {
// var params = {};
// params.sysparm_parent_table = "interaction";
// params.sysparm_parent_sys_id = g_form.getUniqueValue();
g_service_catalog.openCatalogItem('sc_cat_item', 'd95447ce1b973010987d1fc3b24bcba0','-1', params);
});
}
Comments
Post a Comment