- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-15-2020 07:51 AM
Hello,
I have a UI action that redirects to a URL in a new tab, but it does not seem to be working. When I click it, nothing happens, is my code wrong? I want the sys_id of the current record to be attached to the end of the new tab URL. (See pics below)
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-15-2020 08:40 AM
Looks like that may be a scoped application, last I knew "window" was not available in scoped applications but this was a while ago.
Does g_navigation.openPopup(url) work for you instead of window.open?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-15-2020 08:48 AM
I tried this:
function openwin(){
window.open('www.google.com');
}
still nothing happens
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-15-2020 08:40 AM
Looks like that may be a scoped application, last I knew "window" was not available in scoped applications but this was a while ago.
Does g_navigation.openPopup(url) work for you instead of window.open?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-15-2020 08:48 AM
Ah, yea. Scoped app.
Your suggestion should work then.
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-15-2020 08:55 AM
It will open in a new tab except when I try to add the sysID variable at the end of the URL. Any idea why this is?
function openwin(){
var sysID=getUniqueValue();
var url='https://<instance name>.service-now.com/sp?id=sc_cat_item&sys_id=4d7fde5ddb1e00107e137d5e0f9619bc&sysID='+sysID;
g_navigation.openPopup(url);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-15-2020 08:57 AM
Nevermind, solved it:
function openwin(){
var sysID=g_form.getUniqueValue();
var url='https://<instancename>.service-now.com/sp?id=sc_cat_item&sys_id=4d7fde5ddb1e00107e137d5e0f9619bc&sysID='+sysID;
g_navigation.openPopup(url);
}
Thank you!!