- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-24-2020 05:43 PM
Hi Team,
on an incident form we have a UI action - create problem, when create a problem is used a problem will be created with an incident as a reference to it
now we want to open the newly created problem in the next tab of the browser (one tab with the incident and another tab with problem refer to the incident)
any help appreciated
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-24-2020 09:25 PM
You have to use client side script in UI Action to open the record in new tab.
Create one Client callable script include and add your script there and then use glide ajax to call the client side script include.
then you will use below line.
function getprblm(){
var ga = new GlideAjax('createProb');
ga.addParam('sysparm_name', 'cprob');
ga.addParam('sysparm_user_name', g_form.getUniqueValue());
ga.getXML(HelloWorldParse);
function HelloWorldParse(response) {
var answer = response.responseXML.documentElement.getAttribute("answer");
g_form.setValue('problem_id',answer);
g_navigation.open("problem.do?sys_id="+answer, "_blank");
g_form.save();
}
}
var createProb = Class.create();
createProb.prototype = Object.extendsObject(AbstractAjaxProcessor, {
cprob: function(){
var id = this.getParameter('sysparm_user_name');
var gr = new GlideRecord('incident');
gr.get(id);
var prob = new IncidentUtils().getProblemFromIncident(gr);
if(prob != undefined) {
var mySysid = prob.insert();
return mySysid;
}
},
type: 'createProb'
});

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-24-2020 09:25 PM
You have to use client side script in UI Action to open the record in new tab.
Create one Client callable script include and add your script there and then use glide ajax to call the client side script include.
then you will use below line.
g_navigation.open("problem.do?sys_id="+answer, "_blank");
function getprblm(){
var ga = new GlideAjax('createProb');
ga.addParam('sysparm_name', 'cprob');
ga.addParam('sysparm_user_name', g_form.getUniqueValue());
ga.getXML(HelloWorldParse);
function HelloWorldParse(response) {
var answer = response.responseXML.documentElement.getAttribute("answer");
g_form.setValue('problem_id',answer);
g_navigation.open("problem.do?sys_id="+answer, "_blank");
g_form.save();
}
}
var createProb = Class.create();
createProb.prototype = Object.extendsObject(AbstractAjaxProcessor, {
cprob: function(){
var id = this.getParameter('sysparm_user_name');
var gr = new GlideRecord('incident');
gr.get(id);
var prob = new IncidentUtils().getProblemFromIncident(gr);
if(prob != undefined) {
var mySysid = prob.insert();
return mySysid;
}
},
type: 'createProb'
});
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-24-2020 10:36 PM
if you are using server side script then it is not possible to open in new tab
If you are using client side script then script shared by Harshvardhan should work
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader