How to open a new tab when i click on UI action

VIKAS MISHRA
Tera Contributor

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

3 REPLIES 3

Johns Marokky
Tera Guru

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.

Screenshot 2023-03-22 at 9.45.19 PM.png

 

Mark helpful and accept the solution if it helps in solving your query.

 

Regards,

Johns

Prince Arora
Tera Sage
Tera Sage

@VIKAS MISHRA 

 

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.

 

 

AakashG2003
Tera Contributor

Hi @VIKAS MISHRA 

Try this, You will find this helpful.

UI Action.PNG

 

 

 

 

 

 

 

 

 

 

 

 

 

 

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.