Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Dynamics 365 general forum

How to hide add user + button from a Access Team Subgrid

(0) ShareShare
ReportReport
Posted on by 80

Hi,

I have a access team subgrid on a custom form and want to hide if the record status is closed. My question is:

How to hide add user + button from a Access Team Subgrid?

Can someone please help on this?

Thanks!

  • Jane88 Profile Picture
    80 on at
    RE: How to hide add user + button from a Access Team Subgrid

    Hi Leo,

    I tried it and It returns Null.

    Thanks Leo for your help!

    Jane

  • LeoAlt Profile Picture
    16,331 Moderator on at
    RE: How to hide add user + button from a Access Team Subgrid

    Hi Jane88,

    It's very strange situation that I have the same code and position of accessTeam but I did not meet this issue.

    This issue means we can not catch the div element.

    I suggest that you could try to find this element in different levels, like parent.document.getElementbyId()... or window.parent.get...........

    And when finishing the form loading, open F12 development tools and add the code "parent.document.getElementById("gridSAMAccessTeam_contextualButtonsContainer")" in "Watch" section to see if it exists.

    I'm sorry that I've tried many ways but no result :-(

    Best Regards,

    Leo

  • Jane88 Profile Picture
    80 on at
    RE: How to hide add user + button from a Access Team Subgrid

    I got the following error when try the code above:

    TypeError: Cannot read property 'style' of null

    (BTW, we use Dynamics 365 online)

    Thanks!

  • Jane88 Profile Picture
    80 on at
    RE: How to hide add user + button from a Access Team Subgrid

    Hi Leo,

    I got the following error when try the code above:

    TypeError: Cannot read property 'style' of null

    (BTW, we use Dynamics 365 online)

    Thanks!

  • Jane88 Profile Picture
    80 on at
    RE: How to hide add user + button from a Access Team Subgrid

    I got the following error when try the code above:

    TypeError: Cannot read property 'style' of null

    (BTW, we use Dynamics 365 online)

    Thanks!

  • Jane88 Profile Picture
    80 on at
    RE: How to hide add user + button from a Access Team Subgrid

    I got the following error when try the code above:

    TypeError: Cannot read property 'style' of null

    (BTW, we use Dynamics 365 online)

    Thanks!

  • LeoAlt Profile Picture
    16,331 Moderator on at
    RE: How to hide add user + button from a Access Team Subgrid

    Hi Jane88,

    I compared my HTML code to yours and found that the structure is identical.

    You could try the following code to test and see if there is any issue.

    function hideButton(){
    
            var element = parent.document.getElementById("gridSAMAccessTeam_contextualButtonsContainer");
            element.style.display = "none";
    
     
    }


    If the issue still exists, please kindly show me the error log details and your code.

    Thank you very much for your cooperation and understanding :-)

    Best Regards,

    Leo

  • Jane88 Profile Picture
    80 on at
    RE: How to hide add user + button from a Access Team Subgrid

    Access-team1.pngAccess-team1.png

  • Jane88 Profile Picture
    80 on at
    RE: How to hide add user + button from a Access Team Subgrid

    sorry, how to add image?

  • Jane88 Profile Picture
    80 on at
    RE: How to hide add user + button from a Access Team Subgrid

    Thanks Leo!

    Please see below:

    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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 294,079 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 232,860 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans