Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

UI action to redirect to new tab URL

JJG
Kilo Guru

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)

find_real_file.png

 

1 ACCEPTED SOLUTION

jimnicholson
Giga Guru

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?

View solution in original post

10 REPLIES 10

jimnicholson
Giga Guru

Progress!  Think you're missing the g_form in front of your getUniqueValue() now, below is an example of one I have working in my instance:

 

function portal(){
var sys_id = g_form.getUniqueValue();
var url = '/sp?id=ticket&table=sc_req_item&sys_id=' + sys_id;
g_navigation.openPopup(url);
}

 

Hopefully this helps but if it's not working for you still let me know...