How to Open an URL in New Window from UI Action?

Community Alums
Not applicable

Hi All,

I'm redirecting to an URL on click of an UI Action How i can open that URL in New Window?

@Ankur Bawiskar Any idea on this?

 

Thanks Everyone,

Bala

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

if the UI action is server side -> then cannot be done

If the UI action is client side -> use this

g_navigation.open(url, '_blank');

Regards
Ankur

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

View solution in original post

10 REPLIES 10

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

if the UI action is server side -> then cannot be done

If the UI action is client side -> use this

g_navigation.open(url, '_blank');

Regards
Ankur

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

Community Alums
Not applicable

i tried this one @Ankur Bawiskar  but not working

 

Hi,

I already mentioned above that for server side it won't work

For client side I shared the line

share your UI action configuration screenshot

Regards
Ankur

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

Community Alums
Not applicable

@Ankur Bawiskar 

I checked Client checkbox and script as follows:

function a(){

gsftSubmit(null,g_form.getFormElement(),'using action_name here');

}

if(typeof window == 'undefined'){

b

}

function b(){

var url = 'abcd.com';

g_navigation.open(url,'_blank');

}