Show the all Flows attached to the custom record by using "Show Flow" UI action
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2024 05:21 AM
Hi Everyone,
I have an custom table called "SSB Change Request" that run on Flow Designer and flow gets cancelled and attached new flows for different conditions met. I have created the UI action related link "SHOW FLOW". I have written the below Script Include and UI action Script and it's working partially by opening latest attached flow to the record.
But, My requirement is when user clicks the "Show Flow" link, I want to get opened all flows that are attached to that record. How to achieve this?
Script Include:
var AjaxUtils = Class.create(); AjaxUtils.prototype = Object.extendsObject(AbstractAjaxProcessor, { getFlowContext: function() { var id = this.getParameter('sysparm_id'); var flowContextGR = new GlideRecord('sys_flow_context'); flowContextGR.addQuery('source_table', 'u_ssb_change_request'); flowContextGR.addQuery('source_id', id); flowContextGR.query(); var ids = []; while (flowContextGR.next()) { ids.push(flowContextGR.getValue('sys_id')); } return JSON.stringify(ids); }, type: 'AjaxUtils' }); |
UI action Script:
function showFlowContext() { var id = g_form.getUniqueValue(); var ga = new GlideAjax('AjaxUtils'); ga.addParam('sysparm_name', 'getFlowContext'); ga.addParam('sysparm_id', id); ga.getXMLAnswer(function(response) { var ids = JSON.parse(response); for (var i = 0; i < ids.length; i++) { g_navigation.open('/$flow-designer.do#/operations/context/' + ids[i], "_blank"); } }); } |
0 REPLIES 0