How to open a new tab when i click on UI action
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-22-2023 08:37 AM
I have one UI action created on incident form, and the ui action name is "Create story", so whenever i am clicking on this button its opening then new page of story record on the same google tab, however i want this to be opened on new tab, please suggest
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-22-2023 09:17 AM - edited 03-22-2023 09:19 AM
Hi @VIKAS MISHRA ,
You can use the below code to Open a Story in the new tab.
Change the url according to your choice. I had used sn_safe_story. if its rm_story then use url = '/rm_story.do';
function CreateStory(){
var url = '/sn_safe_story.do';
top.window.open(url, '_blank');
}
See the image below for more details.
Mark helpful and accept the solution if it helps in solving your query.
Regards,
Johns
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-22-2023 09:19 AM
This is not possible in server side UI action, for achieving the same
You need to modify the UI action to "client" and using GlideAjax you need to make a record in "rm_story" table and
return the sys_id to client side and open the form in new tab
Please find the link here for more information!
If my answer solved your issue, please mark my answer as ✅Correct & 👍Helpful based on the Impact.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-22-2023 09:21 AM
Try this, You will find this helpful.
function printRecord() {
var sysid = g_form.getUniqueValue(); // It will give you the sys_id of the current record.
var features = "resizable=yes,scrollbars=yes,status=no,toolbar=no,menubar=yes,location=no,width=600,height=400";
var url = '/incident.do?sys_id=' + sysid; // Used to open the same record
g_navigation.open(url, features); // It will open the record in new tab
}
Thanks and Mark helpful and accept the solution if it helps in solving your query.