If you have a custom ribbon button and you want to hide/show it by a condition, this is what you need to do;
- Open Ribbon Workbench and navigate to your button
- Select Command of your button. Under Command properties scroll down to Enable Rules. Click “Add Enable Rule” button. Select “Add New Enable Rule“ to create your enable rule. Note: Enable rules now changes visibility of your buttons, so you don’t need to add Display Rules for that.
- Add your conditions, click Publish to publish your changes.
Below are the most common Enable Rules that you can use.
- Add a ValueRule if you want to change visibility based on a field value. It also works for optionsets, statuscode and statecode fields.
- Add FormStateRule if you want to change visibility based on form state. For instance, Form Create, Update, ReadOnly states.
- Add RecordPrivilegeRule if you want to change visibility based on User’s privilege.