MS Dynamics CRM 2011 :Ribbon Customization Part-1

What is a Ribbon?
Ribbon is the primary location for controls that are used to perform actions in Microsoft Dynamics CRM as shown below. Ribbons facilitate the user s to have the right command at the right place meaning it shows the context sensitive controls and commands

MS Dynamics CRM 2011 Ribbon

Ribbon Contains the Following Elements
1. Tabs
2. Tabs contains the Groups
3. Groups contains the Controls as shown in the below screenshot ( an application level Ribbon)

How many different levels the Ribbon customization can be done?
the answer would be 4 levels and they are

  • Application Level (For Ex: Adding a Tab that will be visible on the entire application)
    • Web Application Ribbon
      • Jewel –A blue tab with the label File that appears far left of the ribbon ( this is also displayed in the entity form) .This provides a Menu item
      • Basic Home Tab:- The basic home tab is displayed on the main application ribbon whenever an alternative tab is not defined, For example, this tab is displayed when you view the Microsoft Dynamics CRM Resource Center
    • Outlook Ribbon
      • Microsoft Office Outlook 2003 and 2007
      • Microsoft Office Outlook 2010
  • Form Level (For Ex: Adding a Tab on all Forms)
  • Grid Level (For Ex: Adding a Tab that will be displayed in grid pages)
  • Entity Level (Fro Ex: Removing a button from the entity)

RibbonDiffXml

Microsoft Dynamics CRM contains default <RibbonDiffXml> (RibbonDiffXml) definitions for all ribbons in the application

The structure of RibbonDiffXml looks like below when we export the RibbonDiffXml from the brand new CRM 2011 installation.

<RibbonDiffXml>

  <CustomActions />

  <Templates>

    <RibbonTemplates Id=”Mscrm.Templates”></RibbonTemplates>

  </Templates>

  <CommandDefinitions />

  <RuleDefinitions>

    <TabDisplayRules />

    <DisplayRules />

    <EnableRules />

  </RuleDefinitions>

  <LocLabels />

</RibbonDiffXml> 

CustomActions : we can do the following actions on the items under custom actions

  • Add an item
  • Replace an item
  • Remove an item
  • Hide an Item

Templates : Collection of Ribbon Templates

Command Definitions :Contains the Commands for the ribbon controls

  • EnableRules
  • Display Rules
  • Actions 
    • Javascript Fucntions
    • URL
    • Outlook command

RuleDefinitons : Contains collection of Rule definitions which include

  • Tab Display Rules : Specify the  conditions  when Tab will display
  • Display Rules :Rule used to display a ribbon element or reference to a “Display Rule “ from a command definition
  • Enable Rules : Enable or disable a ribbon element or   to reference a n “Enable Rule “from  a command definition

LocLables : Specifies a text string associated with a language code.

RibbonNotSupported  :To indicate Entity Doesn’t support the Ribbon. << this is not shown in the above RibbonDiffXml>> ( we will see how this will work in another post)