MVC_Nhibernate
MVC_Nhibernate

Reputation: 457

Dynamics CRM + hide ribbon button only on a particular Form

Is there a display rule (using ribbon workbench) through which one can disable the ribbon button on the Form only on a particular Form and not on all Forms?

Upvotes: 1

Views: 4072

Answers (1)

Aliasgar Rajpiplawala
Aliasgar Rajpiplawala

Reputation: 656

You should use enable rule and write a JavaScript to hide and show button basis the form. Display rule does not support client side script.

disableButton = {
    checkForm: function (context) {
        "use strict";
        var formItem = formContext.ui.formSelector.getCurrentItem();
        if (formItem.getId() === 'your form id'){
        return true;
        }
        return false;
    } 
};

Please follow the link for more details on how to add custom rule. https://d365demystified.com/category/ribbon-workbench/

Upvotes: 1

Related Questions