web
You’re offline. This is a read only version of the page.
close
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

I have the same question (0)
  • Verified answer
    Sayen Zhang Profile Picture
    on at

    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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
Martin Dráb Profile Picture

Martin Dráb 51 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 38 Super User 2025 Season 2

#3
#ManoVerse Profile Picture

#ManoVerse 31

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans