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 CRM (Archived)

How to hide + from a sub grid using JS only

(2) ShareShare
ReportReport
Posted on by 287

Hi,

I need to hide sub-grid's + button using js & not using workbench.

I tried window.parent.document.getElementbyId().style.display='none'.

It is not working .

kindly suggest for dynamics 365.

thanks

Prashant Verma

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    gdas Profile Picture
    50,091 Moderator on at

    Hello Prashant ,

    This is unsupported way but you can try-

    missdynamicscrm.blogspot.in/.../hide-add-existing-button-or-plus-button-subgrid-crm.html

  • Prashnat Verma Profile Picture
    287 on at

    Hi,

    Thank you ..But already tried this. Its not working.

    Thanks

  • Alex Fun Wei Jie Profile Picture
    33,628 on at

    Hi,

    why you want to remove the + from subgrid?

    why don't you remove the create privilege from security role ?

  • Prashnat Verma Profile Picture
    287 on at

    Hi,

    Just I don't want to show it on a form. Its not like they can't create. They can but not from this grid.

    Thanks

  • Suggested answer
    Alex Fun Wei Jie Profile Picture
    33,628 on at

    Hi,

    My opinions "

    Even though if you can achieve via javascript, your user can easily "hack" it through associated view, unless you remove from Navigation.

    Ribbon workbench is your final choice, it is supported and easier to maintain.

    ribbonworkbench.uservoice.com/.../489288-show-or-hide-the-add-new-button-on-form-sub-grid

  • Suggested answer
    Community Member Profile Picture
    on at

    Hi,

    You can use:

    top.document.getElementById("salesorderdetail|NoRelationship|Form|btnRejectDiscount-Medium").style.display = 'none';    

    and this is the id you will it from F12:

    Please refer the links: community.dynamics.com/.../221917

    stackoverflow.com/.../crm-2011-how-to-hide-show-the-ribbon-button-with-javascript

    Thanks

  • Prashnat Verma Profile Picture
    287 on at

    Hi,

    This also didn't work...do I need to add any J library or it will work directly.

    Beacause I applied  using F12 & set the button property display = none & it worked but it is not working in js.

    Thanks

  • Suggested answer
    Community Member Profile Picture
    on at

    Hi,

    if you ever have the choice between a supported and unsupported customization. You always should make the supported one => use RibbonWorkbench!!!

  • Prashnat Verma Profile Picture
    287 on at

    Hi,

    Okay so please advice me how can i achieve this scenario via ribbon.

    I have an Primary entity on which i have a grid of another  entity & I want to hide the + sub grid button just for the primary entity not for others.

    Thanks

    Prashant Verma

  • Suggested answer
    Alex Fun Wei Jie Profile Picture
    33,628 on at

    Hi,

    1. Create a solution

    - put in your entity.

    Make sure you download a backup solution before proceed to next step

    2. Open Ribbon Workbench, select the solution you created just now

    3. Under subgrid section, Hide the button ( right click on the button), Publish. 

    1307.6.png

    1307.6.png

    4011.7.png

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 CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans