- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2020 05:49 AM
Please can someone help me write this UI script so that it opens up the URL in a new browser tab.
var url = '/u_missing_ci.do?sys_id=-1';
url += '&sysparm_query=';
url += 'u_raised_by=' + gs.getUserID();
url += '^u_originating_task=' + current.sys_id;
url += '^u_assignment_group=' + gs.getProperty('si.missing_ci.default_assignment_group');
action.setRedirectURL(url);
action.setReturnURL(current);
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2020 06:01 AM
Hi,
unfortunately you cannot open in new tab in server side using action object
please use client side and below code and it would open in new tab
sharing one link here where I have replied previously
Note: This won't work in client side; so either do glide ajax to get the property value or hard-code the sys_id
gs.getProperty('si.missing_ci.default_assignment_group');
UI Action:
function openRecord(){
var ga = new GlideAjax('getPropertyUtils');
ga.addParam('sysparm_name', "getPropertyValue");
ga.getXMLWait();
var propertyValue = ga.getAnswer();
var url = '/u_missing_ci.do?sys_id=-1';
url += '&sysparm_query=';
url += 'u_raised_by=' + g_user.userID;
url += '^u_originating_task=' + g_form.getUniqueValue();
url += '^u_assignment_group=' + propertyValue;
g_navigation.openPopup(url);
}
Script Include: Client Callable true
var getPropertyUtils = Class.create();
getPropertyUtils.prototype = Object.extendsObject(AbstractAjaxProcessor, {
getPropertyValue: function(){
return gs.getProperty('si.missing_ci.default_assignment_group');
},
type: 'getPropertyUtils'
});
Screenshots:
Mark ✅ Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2020 05:54 AM
HI,
Thanks,
Ashutosh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2020 06:01 AM
Hi,
unfortunately you cannot open in new tab in server side using action object
please use client side and below code and it would open in new tab
sharing one link here where I have replied previously
Note: This won't work in client side; so either do glide ajax to get the property value or hard-code the sys_id
gs.getProperty('si.missing_ci.default_assignment_group');
UI Action:
function openRecord(){
var ga = new GlideAjax('getPropertyUtils');
ga.addParam('sysparm_name', "getPropertyValue");
ga.getXMLWait();
var propertyValue = ga.getAnswer();
var url = '/u_missing_ci.do?sys_id=-1';
url += '&sysparm_query=';
url += 'u_raised_by=' + g_user.userID;
url += '^u_originating_task=' + g_form.getUniqueValue();
url += '^u_assignment_group=' + propertyValue;
g_navigation.openPopup(url);
}
Script Include: Client Callable true
var getPropertyUtils = Class.create();
getPropertyUtils.prototype = Object.extendsObject(AbstractAjaxProcessor, {
getPropertyValue: function(){
return gs.getProperty('si.missing_ci.default_assignment_group');
},
type: 'getPropertyUtils'
});
Screenshots:
Mark ✅ Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2020 09:01 AM
Thanks so much Ankur, that is perfect.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2020 06:04 AM
Hi,
Here are links which will help you.
If it helps,Please mark ✅ Correct and 👍 Helpful.
Warm Regards,
Milind