- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-27-2019 04:32 AM
Hi,
We are trying to trigger both On boarding and detailed assessments from business service form once it is created and we provide this flexibility through a UI actions (buttons). We configured triggers and actions in flow designer.
But is there anyway to call a flow in UI action script?
Urgent help is required.
Solved! Go to Solution.
- Labels:
-
Vendor Risk Management

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-17-2019 08:09 AM
Use below code in the UI action
try {
var flowInputs = {};
flowInputs['current'] = current;
flowInputs['table_name'] = current.getTableName();
var result = sn_fd.Flow.startAsync('SCOPENAME.FLOWNAME', flowInputs);
//The Sys ID of a flow execution (contextId)
var contextId = result.contextId;
} catch (ex) {
var message = ex.getMessage();
gs.error(message);
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-17-2019 08:09 AM
Use below code in the UI action
try {
var flowInputs = {};
flowInputs['current'] = current;
flowInputs['table_name'] = current.getTableName();
var result = sn_fd.Flow.startAsync('SCOPENAME.FLOWNAME', flowInputs);
//The Sys ID of a flow execution (contextId)
var contextId = result.contextId;
} catch (ex) {
var message = ex.getMessage();
gs.error(message);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2020 07:53 AM
Hi
I have added this in my UI action but the flow still needs a trigger condition to get activated.
My aim was not to add any trigger condition in the flow and only this UI action should trigger it.
Can you please let me know how to handle this.
Thankyou
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2022 02:18 PM
This is the one that finally worked for me.
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();
action.setRedirectURL(url);
} else {
gs.addErrorMessage("Record not found");
action.setRedirectURL(_blank);
gs.info(gr.sys_id);
}