Open URL in new blank window

Virendra Dwived
Tera Expert

HI Everyone,

 

I have created one UI Action to launch one custom URL. I am using Client side and Server side both in one UI Action. So, to launch an URL I am using gs.setRedirect(URL) . But it opens that URL in same window rather than opening on new window.

 

Ex: I have this UI Action on incident form. Once this UI Action is clicked it open's the URL in same window. Whereas I want to open the URL in new window and keep the incident form as it is. 

 

Please help me in finding some solution. I have attached code of my UI Action below.

 

cc: @Ankur Bawiskar 

 

Thanks in advance

 

function Popup() {


        gsftSubmit( null, g_form.getFormElement(), 'popup_itsm');
   

}
if (typeof window == 'undefined')
    serverReopen();

function serverReopen() {

   var URL = "https://www.google.com"  // a custom URL will be used here, I have used it only as example
  gs.setRedirect(URL);

}

 

  

9 REPLIES 9

Hi @Saurabh Gupta  

 

As mentioned above it is dynamic URL. I have to get some data from server side also and create URL using that data and then open it in new window. 

 

So, your suggestion won't work in my situation.

 

Thanks

 

Hi @Virendra Dwived 
It can still work, you can get data from server using GlideAjax in client script.

 

 


Thanks and Regards,

Saurabh Gupta

Hi @Saurabh Gupta  

 

Our requirement is in such a way that we don't want to use GlideAjax. 

 

Thanks

Hi @Virendra Dwived 
What is your requirement?

 

 


Thanks and Regards,

Saurabh Gupta

Ankur Bawiskar
Tera Patron
Tera Patron

@Virendra Dwived 

simply use client side UI action and open in new tab

function Popup() {

var URL = "https://www.google.com";
g_navigation.open(url, '_blank');

}

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader