- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-06-2021 03:19 AM
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 ?
Solved! Go to Solution.
- Labels:
-
Now Experience UI Framework
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-06-2021 03:51 AM
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
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-06-2021 03:22 AM
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
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-06-2021 03:42 AM
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-06-2021 03:51 AM
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
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-06-2021 03:54 AM
Thank you