UI action to open the flow in new tab/window
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-19-2022 01:51 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-19-2022 01:54 AM
UI action is on which table?
Which flow context you want to open? the context associated to the current record
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-19-2022 02:02 AM
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
}}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-02-2022 02:30 AM
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");
}
}
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-02-2022 11:04 AM
Hi,
I tried the above code. But it does not trigger anything on click of UI action on the form.
Thanks
Akash