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

Notifications

Announcements

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!

I have the same question (0)
  • LeoAlt Profile Picture
    16,331 Moderator on at

    Hi partner,

    Actually I haven't try this with Access Team, but you could refer to this way.

    You could add your entity to a solution and open this solution in RibbonWorkBench tool.

    And in subgrid level find the + button and hide it and then publish the solution.

    For example, if I want to hide the + button in account form subgrid, I should add the account entity to an solution first and then open the solution in ribbonworkbench.

    community440.png

    And then find the button and hide it.

    community440.png

    About how to install ribbonworkbench, you could refer to this blog.

    https://ribbonworkbench.uservoice.com/knowledgebase/articles/71374-1-getting-started-with-the-ribbon-workbench

    Here are also some similar posts for you.

    https://community.dynamics.com/crm/f/117/t/244901

    https://www.inogic.com/blog/2017/01/hide-add-button-on-a-subgrid-by-applying-custom-javascript-rule/

    Hope it helps.

    Best Regards,

    Leo

  • Jane88 Profile Picture
    80 on at

    Thanks Leo for all information!

    I do use ribbonworkbench. But for the access team gird, I don't know which button (+) to customise on ribbon. I tried to hide all add new (+) on entity 'systemuser' but no luck. The "+" sign still shows up.  

    Thanks!

    Jane

  • LeoAlt Profile Picture
    16,331 Moderator on at

    Hi Jane88,

    I also tried to add an access team subgrid to my account form and wanted to hide the + button by ribbonworkbench but didn't work.

    Looks like that we could only hide it by catch its DOM and set display to none by js code.

    Hope it helps.

    Best Regards,

    Leo

  • Jane88 Profile Picture
    80 on at

    Thanks Leo for your help!

  • LeoAlt Profile Picture
    16,331 Moderator on at

    Hi Jane88,

    If my answer helped you, please mark my answer as verified so that we could help more other users with similar issues.

    Have a nice day.

    Best Regards,

    Leo

  • Jane88 Profile Picture
    80 on at

    I tried to use JS code to set display to none, but document.getelementbyid doesn't work. I found the following article:

    community.dynamics.com/.../261103

    document.getelementbyid is un-supported in D365. So I can't use JS.

    Thanks!

  • Suggested answer
    LeoAlt Profile Picture
    16,331 Moderator on at

    Good day Jane88,

    Actually, D365 supports Native JavaScript, I've done it in my instance with "document.getelementbyid", here is my code.

    var hide = true;
    var interval = null;
    function hidebackButton(){
        interval = setInterval(function () {
            var element = parent.document.getElementById("AccessAccounts_Team_contextualButtonsContainer");
            if (element != null && hide == true) {
                hide = false;
                element.style.display = "none";
                clearInterval(interval);
            }
        }, 1000);
    }


    Just copy this code to Onload event of your form, and replace the "AccessAccounts_Team_contextualButtonsContainer" with your own add button id which could be found in F12 development tools.

    community467.png

    community467.png

    Hope it helps.

    Best Regards,

    Leo

  • Jane88 Profile Picture
    80 on at

    Hi Leo,

    I found the id, but for this line of code:

    parent.document.getElementById("gridSAMAccessTeam_contextualButtonsContainer"), I got element not defined error.

    Thanks!

    Jane

  • LeoAlt Profile Picture
    16,331 Moderator on at

    Hi Jane88,

    Where is your AccessTeam subgrid? Is it on the default tab on the form so that the system could be able to get it when onloading the form.

    For example, my AccessTeam is on the account main form Summary tab which means once you open the form, you can see the subgrid directly. If the tab which your subgrid is in needs to be clicked before it can be displayed, you should move the subgrid to your default tab or set the tab as default.

    Could you kindly share your screenshot about your entity form and your access team position?

    Hope it helps.

    Best Regards,

    Leo

  • Jane88 Profile Picture
    80 on at

    Thanks Leo!

    The access team is located on the second tab on our custom entity (main form). It is visible by default. I don't know how to set the tab with the access team to default tab. I can't find the option/settings to set the default tab.

    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 > Dynamics 365 general

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans