web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

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

How to hide related subgrid button on readonly

(0) ShareShare
ReportReport
Posted on by 90

Hello,

How can I hide the add new button on related subgrid when the form is readOnly.

I have tried the following but it does not seem to work for me

pastedimage1622912396851v1.png

Thanks in advance

I have the same question (0)
  • Suggested answer
    Wahaj Rashid Profile Picture
    11,321 on at

    Hi,

    Thank you for your query.

    Use Enable Rule (instead of Display Rule).

    Also, here is a related post (it does something else, but you will get some idea):

    Unlocking “add new” on the subgrids for read-only records | It Ain't Boring (itaintboring.com)

  • Ainsley Profile Picture
    90 on at

    nope didnt work for me, im not sure if the subgrid is aware of the parent.context

  • Verified answer
    Community Member Profile Picture
    on at

    Hi Ainsley,

    You can do this by adding enable rule for + or Add New Button.

    1. Open Child record customization in Ribbon workbench
    2. Select Entity so that we will able to modify command definition.
    3. In Sub Gird, select + Add New {0} Button, right click and select Customize Command.
    4.  Add New Enable Rule
    5. For Enable Rule.. Add steps, and select Custom Rule.

    Js code:

    function DisableSubGridNewButton() {

        if (Xrm.Page.ui.getFormType() == 3) // Read Only

            return false;

        else

            return true;

    }

    Maybe you can refer following link:

    (+) Hide SubGrid '+' / New Button button based on Parent status - Microsoft Dynamics CRM Community

    Regards,

    Leah Ju

    Please mark as verified if the answer is helpful. Welcome to join hot discussions in Dynamics 365 Forums.

  • Suggested answer
    Community Member Profile Picture
    on at

    Hi Ainsley,

    You can do this by adding enable rule for + or Add New Button.

    1. Open Child record customization in Ribbon workbench
    2. Select Entity so that we will able to modify command definition.
    3. In Sub Gird, select + Add New {0} Button, right click and select Customize Command.
    4.  Add New Enable Rule
    5. For Enable Rule.. Add steps, and select Custom Rule.

    Js code:

    function DisableSubGridNewButton() {

        if (Xrm.Page.ui.getFormType() == 3) // Read Only

            return false;

        else

            return true;

    }

    Maybe you can refer following link:

    (+) Hide SubGrid '+' / New Button button based on Parent status - Microsoft Dynamics CRM Community

    Regards,

    Leah Ju

    Please mark as verified if the answer is helpful. Welcome to join hot discussions in Dynamics 365 Forums.

  • Ainsley Profile Picture
    90 on at

    thanks!

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

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

#1
Pallavi Phade Profile Picture

Pallavi Phade 102 Super User 2026 Season 1

#2
Abhilash Warrier Profile Picture

Abhilash Warrier 55 Super User 2026 Season 1

#3
ManoVerse Profile Picture

ManoVerse 49 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans