Double Clicking Issue

1
There is a microflow that adds an object. When the user quickly presses the action button. The microflow is getting called multiple times (the number of times the user clicked it) Already tried: Adding the blocking popup from microflow setting to synchronous and blocking. Used do not allow concurrent transaction. I still see the microflow being called. Any suggestion?  
asked
3 answers
2

Hi Akash,

You can enable Disable during action boolean, it should solve this issue.

answered
0

I dont see that option available for some reason on the button settings

answered
0

Found a solution

Used this in the javascript snippet (Datasource)

(function() {
    var form = this.mxform,
        formWidgets = form.getChildren(true),
        button = formWidgets.filter(function(w) { return w.declaredClass === 'mxui.widget.ControlBarButton'})[0],
        grid = formWidgets.filter(function(w) { return w.declaredClass === 'mxui.widget.DataGrid'})[0],
        context = this.mxcontext;
    if(!button || !grid)
        return;

    button.onClick = function() {
        var selected = grid.selection;
        if(!selected.length) {
            mx.ui.info('Select at least one row.', false);
            return;
        }
        button.disable();
        mx.ui.action('Domainname.Nameofthemicroflow', {
            params: {
                applyto: 'selection',
                guids: selected
            },
            context: context,
            origin: form,
            callback: function() {/*closes the form so don't need to re enable*/ },
            error: function() { 
                mx.ui.error("There was an error processing the request");
                button.enable(); 
            }
        })
    }
}.bind(this))();
 

answered