
I have a Contact form, and on this form I have a subgrid with all related Orders, and I would like to hide Deactivate Button based on the security role, so I created a javascript to check user security role and return true or false and based on that hide or display Deactivate button.
It works when no record is selected in Subgrid, it also works when I open the Order record, however it doesn't work when I select the Order in subgrid, and the issue is that the Deactivate Button doesn't appear at all. Could somebody suggest what I should do?
I followed those steps:
So for the subgrid Deactivate button I added the following rule, then the rule was added to the command for Deactivate button in subgrid
Hi tomNm,
Here are the steps to hide “Deactivate” button in subgrid when a row is selected:
1. Navigate to https://make.powerapps.com/
2. Click solution and then add Contact form in it.
3. Open Ribbon Workbench solution
4. Click solution that contains Contact form.
5. Select “Deactivate” button and click “customize the button”.
6. Add enable rules and create “SelectionCountRules”.
7. Enter “1” in Minimum
8. Add enable rules in Command.
9. Select command in Buttons and then publish.
10. “Deactivate” button in subgrid will be hided when a row is selected.
If you have any questions, you can also reply to let us know. Thank you!
Best Regards,
Sayen Zhang
Please mark as verified if the answer is helpful. Welcome to join hot discussions in Dynamics 365 Forums.