Open URL in new blank window
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-21-2023 01:58 AM - edited 12-21-2023 02:02 AM
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);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-21-2023 02:31 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-21-2023 02:37 AM
Hi @Virendra Dwived
It can still work, you can get data from server using GlideAjax in client script.
Thanks and Regards,
Saurabh Gupta
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-21-2023 02:42 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-21-2023 02:43 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-21-2023 04:33 AM
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.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader