Friday 28 September 2012

Hide/Show subgride ribbon button in CRM 2011 is different as compare to CRM 4.0.
In CRM 4.0, Entities XML and Ribbon details are combining into signal ISV file.so you easily customize ribbon by exporting and importing ISV file. 
But in CRM 2011, Application ribbons are separate separate with the name of "Application Ribbon".
if you want to edit ribbon of sub Grid of any entity, simply create a new solution and add those entities in that solution. For example you want to edit the Sub-Gird ribbon of "Account" entity and want to hide "Add Existing" and "Add New" button.


Firstly you create a new solution and
Then add this "Account" entity to a new created solution.

                            

and then add "Application Ribbon" in that solution.


and then export that solution with two components, "Account" and "Application Ribbon".

                                         

and after exporting that solution. Unzip that solution and edit the "customizations.xml" file into any xml editor or simply in notepad. Search account entity and directly go to "<CustomActions>" tag into "<RibbonDiffXml>" tag. Write that code. In this example, I just hide the "Add Existing" and "Add New" button.


then save and import this customization file. After publishing these changes you can see subgrade Add New and Add Existing button will be hided. Similarly you can use these steps with any system or custom entity.
After hiding those buttons grid will be display like this,