Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Answered

How to hide Deactivate button from subgrid

(0) ShareShare
ReportReport
Posted on by 12

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:

  1. Opened Child record customization in Ribbon workbench
  2. Selected Entity so that we will able to modify command definition.
  3. In Sub Gird, selected Deactivate Button, then right clicked and selected Customize Command.
  4.  Added New Enable Rule
  5. 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

order.JPG

  • Verified answer
    Sayen Zhang Profile Picture
    on at
    RE: How to hide Deactivate button from 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

    pastedimage1680513934216v5.png

    8. Add enable rules in Command.

    pastedimage1680513884991v3.png

    9. Select command in Buttons and then publish.

    pastedimage1680513957567v6.png

    10. “Deactivate” button in subgrid will be hided when a row is selected.

     pastedimage1680513994564v7.png

     

    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.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Ramesh Kumar – Community Spotlight

We are honored to recognize Ramesh Kumar as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
Adis Profile Picture

Adis 136 Super User 2025 Season 1

#2
Sohail Ahmed Profile Picture

Sohail Ahmed 81

#3
Jonas "Jones" Melgaard Profile Picture

Jonas "Jones" Melgaard 77 Super User 2025 Season 1

Product updates

Dynamics 365 release plans