Dynamics 365- Hide button in command bar on form field value condition (Display Rule)- Ribbon workbench (Part-4)
In this post we will see how we can only display a command button on some form field value condition. Watch my previous blogs where I explained :
2. How to add a button and call URL Action in Dynamics 365
3. How to trigger JavaScript function on button click in Dynamics 365
Now let us see how we can hide a button on some field value of a form in dynamics 365. Follow previous blogs to know how to add commands for a button then come to this blog as this is a continuation blog of previous blogs.
Step:1 – Configure Display Rule in Ribbon Workbench
Open Ribbon workbench and load the solution containing the entity which has the button. Select the button and navigate to Display Rule and add a new Display rule.
Click on Add Step and select Value Rule.
in the next step provide the logical name of the field you want to check and provide the value for conditional check.
Next associate the Display rule to the command.
Now Publish the ribbon workbench changes and test.
Open any account form and change the Relationship Type as “Press” then you will see the Show Message button will be displayed but if you change to any other type hew button will hide.
When PRESS is selected the button is visible.
Hope this helps