how to open a new tab when you click a UI Action button?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-06-2021 10:25 AM
here is script i am using in my UI Action:
var change = new GlideRecord("change_request");
change.initialize();
change.short_description = current.short_description;
change.description = current.description;
change.cmdb_ci = current.cmdb_ci;
change.priority = current.priority;
change.assigned_to = current.assigned_to;
var changesysID = change.insert();
gs.addInfoMessage("Change " + change.number + " created");
action.setRedirectURL(change);
action.setReturnURL(current);
i am trying to open a new tab when i click on a UI Action button.
any help would be appreciated.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-06-2021 11:28 AM
Hi,
Set your UI action to client and try the following:
g_navigation.open("URL", "_blank"); //copy the url of the page you want to open in new tab
Regards,
Gunjan
Please Mark My Response as Correct/Helpful based on Impact
Regards,
Gunjan Kiratkar
2X ServiceNow MVP
Community Rising Star 2022
Youtube : ServiceNow Guy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-06-2021 11:35 AM
Already tried but its not working.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-20-2023 08:55 AM
@Faraz2 I am in a similar situation as you. Have you managed to achieve your goal?"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-06-2021 11:36 AM
Hi Faraz,
You can use anchor tag where in href you can provide your link and and in the target value you can pass _blank. This will help you open a new window with the click of your UI action.
<a href="https://www.w3schools.com" target="_blank">Visit W3Schools!</a>
Please mark this answer as correct and helpful if it resolves the query and helpful alone if it lead you in right direction.
Thanks,
Mohit Kaushik
Mohit Kaushik
ServiceNow MVP (2023-2025)