Thursday, January 4, 2024

Show Button based on records selection in Ribbon Work Bench

If you have a button in subgrid or home grid in Dynamics 365 that you only want to show when at least one record is selected (and say max 50 records) , you can use a feature called Enable Rule in Ribbon Workbench. 

Here's how:
1. Open your solution in Ribbon Workbench.
2. Create a new Enable Rule and choose 'SelectionCountRule.'
3. Set the minimum count to 1 and the maximum count to your preference (e.g., 50).
4. Apply the rule to the 'Selected Entity,' and set Default to True and InvertResult to False.
After setting up the rule, link it to your button command. Make sure your button always has a command attached, and you can manage all your display rules inside this command.


The steps with snapshots are provided below for your easy reference.

1. Open Ribbon Workbench and navigate to Enable Rule.


2. Create a new Enable Rule and click on "Add Step."
3. Choose "SelectionCountRule" from the options.

4. Specify the minimum and maximum count values (e.g., show the button when at least one record is selected, and a maximum of 50).
Set the rule to apply to "Selected Entity" with Default set to True and InvertResult to False.


5. After configuring the Enable Rule, go to the button command to associate the enableRule with the button's command.
6. Click on "Add" to include your enable rule in this command.


7. Select your enable rule within the command settings.

Finally, publish the solution to apply the changes.






No comments:

Post a Comment

Followers

Power Dynamix YouTube Videos