← Back to list

Dynamics 365 — Ability to Show Buttons on one and hide on another Sub grid of same entity - It was…

Have you ever come across a situation where you feel that a certain thing isn’t possible because of the way it is perceived? I am pretty…

Saloni · 2022-02-03 15:42 · 36 claps · 1.9 min read
#dynamics-365 #ribbon-workbench #javascript #ms-crm-development
Open on Medium ↗
Wiki topics: 🌐 · Web Development

Dynamics 365 — Ability to Show Buttons on one and hide on another Sub grid of same entity - It was there, We Just didn’t know it!

Have you ever come across a situation where you feel that a certain thing isn’t possible because of the way it is perceived? I am pretty sure, this might be the case with many of us where we thrive on a limited set of use cases and never think out of the box.

As a Dynamics CRM developer, I came across one such scenario where I assumed, rather was a 100% sure that the way entities are designed in MS CRM, we cannot differentiate multiple sub grids’ buttons and we cannot find the trigger point of the same button from multiple grids! We can very well show or hide them based on the Enable/Display rules from RibbonWorkbench (that’s for another day! ;) ) but these rules will be applied simultaneously on all the sub grids of the entity which is a pain point.

Well, you have come to a right place and today is your day! Without much a do, let’s jump straight on the solution-

People who are familiar with the Ribbon Workbench, must very well know that there are CRM Parameters available that can be passed to the Javascript function and out of those parameters, one is SelectedControl. Here, SelectedControl is the sub grid where the button is placed.

Enable Rule for a button

Enable Rule for a button

Once, SelectedControl is passed in the javascript, we could then fetch the _controlName of the SelectedControl( Bingo! you guessed that right, this is the miraculous ingredient of our dish) which can differentiate the placement of the button on a sub grid.

Javascript code

Javascript code

Voila, our button ‘Create’ is now visible on sub grid no 2 and is hidden on sub grid no 1( both the sub grids being of Opportunity entity)

Two sub grids of opportunity entity on the same form

Two sub grids of opportunity entity on the same form

So, yeah it was there, we just didn’t know it!


메타데이터
post_id
4d00c50ddb6a
slug
dynamics-365-ability-to-show-buttons-on-one-and-hide-on-another-sub-grid-of-same-entity-it-was-4d00c50ddb6a
url
https://medium.com/@salonigaba21/dynamics-365-ability-to-show-buttons-on-one-and-hide-on-another-sub-grid-of-same-entity-it-was-4d00c50ddb6a
canonical_url
https://medium.com/@salonigaba21/dynamics-365-ability-to-show-buttons-on-one-and-hide-on-another-sub-grid-of-same-entity-it-was-4d00c50ddb6a
author_url
https://medium.com/@salonigaba21
status
ok
fetched_at
2026-08-10 22:12:00