Search code examples
dynamics-crmdynamics-crm-2013dynamics-crm-online

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?


Solution

  • 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/