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:
- Opened Child record customization in Ribbon workbench
- Selected Entity so that we will able to modify command definition.
- In Sub Gird, selected Deactivate Button, then right clicked and selected Customize Command.
- Added New Enable Rule
- For Enable Rule.. Added steps, and selected Custom Rule
So for the subgrid Deactivate button I added the following rule, then the rule was added to the command for Deactivate button in subgrid