Ribbon Customization Part-10-Hide ‘Add Existing’ button in Dynamics CRM 2011

To day we will see how to hid the ‘Add existing’ button on the Contact Associated view on the Account Entity. (Hiding Add Existing button was a very popular requirement in CRM 4.0)

When you open an Account entity record and click on ‘Contacts’ in the left navigation bar of the entity. you can see’Add New Contact’ and ‘Add Existing Contact’ buttons. Today we will see how to hide them using the Ribbon Customization

Follow the bellow steps

  1. Create a Solution ‘Add Contact entity
  2. Export the solution
  3. Unzip and Edit the Customizations.xml file
  4. Now we need to fine the Id of the ‘Add Existing’,Add New’ Buttons  For this I opened the ‘contactribbon.xml’ which is available under ..\\sdk\samplecode\cs\client\ribbon\exportribbonxml\exportedribbonxml( this location depends on the Sdk installation directory  on the file system)
  5. I found the ids as shown  below from the contactribbon.xml
  6. ContactRibbon
  7. Add  the below code  in the RibbonDiffXML
  8.    1: <CustomActions>

       2:          <HideCustomAction Location="Mscrm.SubGrid.contact.AddNewStandard" HideActionId="sample.Mscrm.SubGrid.contact.AddNewStandard.HideAction" />

       3:          <HideCustomAction Location="Mscrm.SubGrid.contact.AddExistingAssoc" HideActionId="sample.Mscrm.SubGrid.contact.AddExistingAssoc.HideAction" />

       4:          <HideCustomAction Location="Mscrm.SubGrid.contact.AddExistingStandard" HideActionId="sample.Mscrm.SubGrid.contact.AddExistingStandard.HideAction" />

       5:        </CustomActions>

  9. Save it, Zip it and Import the Solution
  10. Refresh the browser the screenshot looks like below
  11. Hide Add Exisitng Buttons
  12. Download the entire solution from here.
Advertisements

3 Responses to Ribbon Customization Part-10-Hide ‘Add Existing’ button in Dynamics CRM 2011

  1. Rick Gipson says:

    Can you point me in a direction of a reference for all directives/shortcuts ($webresource and {!EntityLogicalName}) that can be used in the CRM 2011 Ribbon XML? I’m hoping there directive/shortcut that allows me to get access the Orginization Name.

    Thanks,

    Rick

  2. Ajay Chawla says:

    Hi Siva,

    Can we conditionally hide an existing button in the ribbon?
    how can we write a javascript which returns bool & depending on the returned value, the existing button is displayed or hidden.

    Thanks
    Ajay Chawla

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: