UI Action "Show Flow" is not working for custom table
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-12-2024 12:09 AM
Hi Everyone,
I have an custom table called "SSB Request" that run on Flow Designer and flow gets cancelled and new flow attached 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' }); |
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"); } }); } |
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-12-2024 12:49 AM
I think you will have to modify the URL which gets opened.
Ideally it makes sense to show the current flow attached rather than all previous ones.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-03-2024 08:16 PM
Hi @ankur
My requirement is like I want to show current flow attached. How should I configure my UI action?
thanks
bharat