Not able to open link in new window from UI action server side script

Ranjita1
Kilo Contributor

Hi,

I have created new UI action and i want to open the link in new window.

action.setRedirectURL(url,'_blank'); or gs.setRedirect('/xyz.do?sys_id=' +current.sys_id,'_blank'); are not working.

I want to achieve this with server side script without using client side.

Could anybody please help me ?

 

 

1 ACCEPTED SOLUTION

Hi,

Since you are talking about UI action

UI Action can only pass control from client to server

Not possible to pass control from server to client

So you better use glideajax based approach and then use g_navigation to open in new tab

If my response helped you please mark it correct to close the question so that it benefits future readers as well.

Regards
Ankur

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

View solution in original post

5 REPLIES 5

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

not possible using server side UI action

Only possible in client side script

In client side UI action you can do this

var url = '/xyz.do?sys_id=' + g_form.getUniqueValue();

g_navigation.openPopup(url);

Regards
Ankur

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

Hi Ankur,

Thanks for your reply.

I need to get sys id of different record which can be fetched by serverscript only.

instead of creating other script include and use glideAjax to call it from client side script, is there any possibility to fetch the details from server script and display the URL in new tab using client side script in single UI action?

Hi,

Since you are talking about UI action

UI Action can only pass control from client to server

Not possible to pass control from server to client

So you better use glideajax based approach and then use g_navigation to open in new tab

If my response helped you please mark it correct to close the question so that it benefits future readers as well.

Regards
Ankur

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

Thank you