- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-15-2019 01:56 AM
I have a custom table that has a field that contains a URL to an external website. I would like a UI Action that opens that link in a new tab.
I have tried the following:
window.open(current.link, '_blank');
With no success. Is this actually possible?
Thanks,
Ellis
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-15-2019 02:21 AM
Hi Mate,
Sorry that was a server side call, I just wrote this and tested it. It works as you requested.
Script:
function onClick(){
var url = g_form.getValue('field_name');
g_navigation.openPopup(url);
}
Let me know how you go with this one.
If this answered your question please mark as correct.
Thanks
Mark

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-15-2019 02:07 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-15-2019 02:17 AM
Hi Mark,
A couple of problems:
The link doesn't open in a new tab, it tries to open it in the current ServiceNow window and I get an error that the website refused to connect.
Also something I didn't mention in the question is I want this as a form link and your code only works with a form button.
Thanks,
Ellis

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-15-2019 02:21 AM
Hi Mate,
Sorry that was a server side call, I just wrote this and tested it. It works as you requested.
Script:
function onClick(){
var url = g_form.getValue('field_name');
g_navigation.openPopup(url);
}
Let me know how you go with this one.
If this answered your question please mark as correct.
Thanks
Mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-15-2019 02:28 AM
Great that's perfect. Thanks Mark