Under the hood – the CRM 2011 Ribbon

Here’s my high level (and very likely incorrect) understanding of how CRM determines how to render the application ribbon at runtime.  These notes are just my guesses based on my observations.  There’s plenty I’m not taking into account but I think these are useful notes and I’ll be coming back to these when I need to figure out to get a button added in the right place, looking the right way…

  • Each ribbon is essentially a collection of tabs
  • Tabs follow a strict naming convention which is used to determine which Tabs should be displayed.
  • The ribbon is constructed at run time based on:
    • the entity that has focus
    • whether the focus is on the entity’s form, grid, or contextual grid
  • i.e. If the Account Form is launched CRM looks for Tabs with names that conform to one of the 2 following masks:
    • Mscrm.Form.account.*
    • Mscrm.Form.{!EntityLogicalName}.*
  • The ribbon is constructed based on a combination of the global ribbon definition, the entity specific ribbon definition and any customisations you have made to either of those.   In each of these places each Tab may have properties defined.
  • CRM effectively reads these definitions from applicationribbon.xml, accountribbon.xml plus any RibbonDiff customisations you have made to either the Application Ribbon or to the Account entity.
  • I suspect the layering order starts with the base defined in applicationribbon.xml, overlays that with the changes defined in accountribbon.xml and then overlays that with the changes defined in your customisation to the application ribbon and then finally the Account entity customisations are applied. i.e.:
    • Out-of-the-box global definition
    • Out-of-the-box entity specific definition
    • Customisations to the global definition
    • Customisations to the entity specific definition
  • When rendering a specific group on a tab CRM obeys:
    • The scaling rules defined under the Tab (specified for each Group)
    • The Template defined for the Group
    • The Template Alias defined for each Button
    • The Sequence defined for each Button
  • e.g. When a Group uses Template Id “Mscrm.Templates.Flexible3” and the Group uses the “LargeMediumLarge” layout when at Max Size then the buttons in that group will be rendered in the following order:
    • Those with a Template Alias of o1 are rendered in sequence order, each displayed as large icons
    • Those with a Template Alias of o2 are rendered in sequence order, each displayed as medium icons in a 3 row (stacked) configuration
    • Those with a Template Alias of o3 are rendered in sequence order, each displayed as large icons
  • I get this from the GroupTemplate definition for Mscrm.Templates.Flexible3 which I find in applicationribbon.xml:

image_thumb[110]

Advertisements

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