Sunday, July 17, 2011

Step by Step - Hiding “Add Existing” button in CRM 2011

In MSCRM 4.0, hiding the “Add Existing” button was a very common request. This blog will show how to do this in CRM 2011. When we click on associated record link in left navigation of an entity form, we can see a "Add Existing" button on the ribbon. To hide this button we need to modify the ribbon of the associated entity.
The following screen shot is of an account entity. If we click on "Contacts" on left navigation, we can see the "Add Existing Contact" button on the ribbon. To hide this button we need to modify the ribbon of the contact entity.
image
Here are the steps
  • Create a new solution.
  • Add the contact entity to the solution. Do not include any required components or dependent components to the solution.
  • Export the solution and unzip the solution file.
  • Open the customizations file and look for “<RibbonDiffXml>” tag.
  • Replace the <CustomActions /> with
<CustomActions>
  <HideCustomAction Location="Mscrm.SubGrid.contact.AddExistingAssoc" HideActionId="Mscrm.SubGrid.contact.AddExistingAssoc.HideAction" />
  <HideCustomAction Location="Mscrm.SubGrid.contact.AddExistingStandard" HideActionId="Mscrm.SubGrid.contact.AddExistingStandard.HideAction" />
</CustomActions>
  • Save the file.
  • Replace the customizaions.xml file in your zip solution with this file.
  • Import the solution and publish the changes.
Note: Replace the highlighted "contact” text with your entity name. It can be “opportunity” or a custom entity like “new_entity” etc.

Good day…………..