- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-24-2021 11:11 AM
Hello! I have implemented an Interceptor for when you are going to create a new incident onbehalf of the users, according to the type of case that is necessary to create the interceptor will direct the agent to a form that is related to a particular table.
However, I have not managed to see this reflected in the Agent Workspace, I mean when from the Agent Workspace you click on the New button, it sends directly to the sn_customerservice_case table without considering the type of case you want to create.
I want to implement something similar to what happens when from Agent Workspace you try to create a new Change Request. Could anyone guide me on how to do it? I would be very grateful
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-25-2021 01:27 AM
Hi,
Put the script inside "Workspace client script" on your UI Action.
Script include:
var getUrlSio = Class.create();
getUrlSio.prototype = Object.extendsObject(global.AbstractAjaxProcessor, {
getURL: function(){
var id = gs.getProperty("glide.servlet.uri");
var url = id+'wizard_view.do?sys_target=&sysparm_wizardAction=sysverb_new&sysparm_parent=8db4a378c611227401b96457a060e0f4';
return url;
},
type: 'getUrlSio'
});
UI Action Script:
function onClick(g_form) {
alert('hey');
var ga = new GlideAjax('sn_itsm_workspace.getUrlSio');
ga.addParam('sysparm_name', 'getURL');
ga.getXML(HelloWorldParse);
function HelloWorldParse(response) {
var answer = response.responseXML.documentElement.getAttribute("answer");
//alert(answer);
var win = top.window.open(answer, '_blank');
win.focus();
}
}
Refer this to learn more : https://community.servicenow.com/community?id=community_question&sys_id=1274159bdbbb68106064eeb5ca96192c
Please mark my answer as Correct & Helpful, if applicable.
Thanks
Sandeep
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-25-2021 01:27 AM
Hi,
Put the script inside "Workspace client script" on your UI Action.
Script include:
var getUrlSio = Class.create();
getUrlSio.prototype = Object.extendsObject(global.AbstractAjaxProcessor, {
getURL: function(){
var id = gs.getProperty("glide.servlet.uri");
var url = id+'wizard_view.do?sys_target=&sysparm_wizardAction=sysverb_new&sysparm_parent=8db4a378c611227401b96457a060e0f4';
return url;
},
type: 'getUrlSio'
});
UI Action Script:
function onClick(g_form) {
alert('hey');
var ga = new GlideAjax('sn_itsm_workspace.getUrlSio');
ga.addParam('sysparm_name', 'getURL');
ga.getXML(HelloWorldParse);
function HelloWorldParse(response) {
var answer = response.responseXML.documentElement.getAttribute("answer");
//alert(answer);
var win = top.window.open(answer, '_blank');
win.focus();
}
}
Refer this to learn more : https://community.servicenow.com/community?id=community_question&sys_id=1274159bdbbb68106064eeb5ca96192c
Please mark my answer as Correct & Helpful, if applicable.
Thanks
Sandeep
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2021 08:36 AM
Thanks, Sandeep. I did what you suggest and is working fine, however it creates a new tab in my browser, is possible to do this but keeping inside the Agent workspace window?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2021 12:36 PM