The navigation within Microsoft Dynamics CRM 2011 has completely changed. Similar to the Microsoft Office application, Microsoft Dynamics CRM 2011 introduces the ribbon, as shown below, as the primary location of controls that are used to perform actions in the application:
There are some key concepts that you need to understand, and also common tasks you will need to perform, when customizing the ribbon. In order to customize the ribbon, it would help if you have a background in XML because as of now when we at the time of writing this book, there are no tools available for customizing the ribbon.
Microsoft Dynamics CRM contains a default definition for all of the ribbons in the application. You can export and view the current XML code that defines the ribbon for your own CRM organization, but you can't update the XML directly. Keep in mind that if you want to change the ribbon, you need to define how you want it changed. All of the changes that you want to make to the ribbon will be stored in RibbonDiffXml
, which is located in the entity customization XML file.
When you customize your ribbon by writing your change definition, you need to reference the definition of the default ribbons. For example, if you need to add a button or a group next to an existing ribbon element, you need to know the ID values for those elements, as well as the sequence order with which you will control the relative position of the elements. To get the ID values of the existing ribbon elements, you need to export the ribbon definition.
Exporting the entities ribbon requires a tool provided in the Microsoft CRM SDK. Please follow the steps below to export the ribbons from CRM.
Note: In order to run the ribbon export tool, you need to have Visual Studio 2010 installed on your local computer. Also you need to download and extract the latest Microsoft CRM 2011 SDK to your local computer. To download the CRM 2011 SDK, please visit the Microsoft Download Site at http://www.microsoft.com/download/en/details.aspx?id=24004. The ribbon export tool is in the SampleCodeCSClientRibbonExportRibbonXml ExportedRibbonXml
folder.
exportribbonxml.sln
file to launch the Visual Studio project.When the application has finished exporting the ribbon definitions, all of the ribbon definitions for the entities will be available in the exportedribbonxml
folder where your project is placed. Let's take a look at the different types of ribbons before we start customizing the ribbon for our ACM system. We'll need to refer back to the ribbon definitions that we exported here when we customize the ribbon in the samples below.
All entities in Microsoft Dynamics CRM 2011 leverage the same Entity Ribbon Template as the base ribbon definition. Each system entity has a separate RibbonDiffXml
definition that builds upon the entity ribbon template definition. The base ribbon definition is stored in a file called applicationribbon.xml
.
The entity grid ribbon is a collection of tabs that have an ID attribute value beginning with Mscrm.HomepageGrid.<entity
logical name>
. For example, the tab with the text "Contacts" on a contact entity grid is Mscrm.HomepageGrid.contact.MainTab
. All of the tabs displayed on the account entity grid will have an ID value that begins with Mscrm.HomepageGrid.contact
. Please take a look at the following screenshot:
When a list of records for a different entity is displayed within a sub-grid on the form of another entity or in a chart, the ribbon will change when the user places the cursor in the grid. Please take a look at the next screenshot.
The entity sub-grid ribbon is a contextual group with a collection of tabs that have an ID attribute value beginning with Mscrm.SubGrid.<entity
logical
name>
. For example, the tab with the text "Contacts" on the contact entity sub-grid is Mscrm.SubGrid.contact.MainTab
.
Each entity can have multiple forms. You can define changes to the form ribbon for all forms for that entity by adding your definition at the entity level in //ImportExportXml/Entities/Entity/RibbonDiffXml
. If you would like to change the ribbon for the specific form, you need to modify RibbonDiffXml
at this location: //ImportExportXml/Entities/Entity/FormXml/forms/systemform/form/RibbonDiffXml
.
The entity form ribbon is a collection of tabs that have an ID attribute value beginning with Mscrm.Form.<entity
logical
name>
. For example, the tab with the label Contact on the contact entity form is Mscrm.Form.contact.MainTab
. All of the tabs displayed on the contact entity form will have an ID value that begins with Mscrm.Form.contact
.