UI action to open the flow in new tab/window

Akash Singh2
Tera Contributor

Hello,

 

I am unable to build URL for opening the record specific flow designer in new tab. Basically when i click on ui action on custom form, it should redirect to flow designer execution in new tab.

Have tried with below options but doesnt seem to be working.

g_navigation.openPopup(url);

g_navigation.open(url.getURL(), "_blank");

window.open

 

kindly suggest any solution to handle this.

 

Thanks 

Akash

5 REPLIES 5

Ankur Bawiskar
Tera Patron
Tera Patron

@Akash Singh2 

UI action is on which table?

Which flow context you want to open? the context associated to the current record

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hi Ankur,

 

Ui action is on one custom table. Yes flow context associated with current record.

pls find the code below:

function test(){
var gr = new GlideRecord('sys_flow_context');
gr.addQuery('source_record', current.sys_id);
gr.query();
if (gr.next()) {

 var url = '$flow-designer.do?sysparm_nostack=true#/operations/context/' + gr.sys_id.toString();
window.open('url', _blank); ---> does not work
g_navigation.open(url.getURL(), "_blank");----> does not work
action.setRedirectURL(url)----> works but opens in same tab

}}

@Akash Singh2 

try this

function test(){
var gr = new GlideRecord('sys_flow_context');
gr.addQuery('source_record', g_form.getUniqueValue());
gr.query();
if (gr.next()) {
var url = '$flow-designer.do?sysparm_nostack=true#/operations/context/' + gr.sys_id.toString();
g_navigation.open(url, "_blank");
}
}

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hi,

I tried the above code. But it does not trigger anything on click of UI action on the form.

Thanks

Akash