In Dynamics CRM 2011, when editing the ribbons it is important to understand the effects that the TemplateAlias and Sequence can have on your overall results. When adding a Contextual Help button to Dynamics CRM 2011 I noticed that the value given to Sequence was very important as it effected how the ribbon was loaded and rendered.
Through trying to implement a new button on the ribbon I also found that an incorrect sequence would stop the button from showing at all. I checked and rechecked my code and all that was left was the sequence and the TemplateAlias. Through testing reading I have found the following:
When rendering the ribbon Dynamic CRM 2011 first looks at the TemplateAlias. From here all items within a group of buttons which have the same TemplateAlias are then rendered in Sequence order.
For Example:
All buttons using TemplateAlias “o1” are rendered in sequence order (from smallest to largest) and each is displayed as a large icon. All buttons using the "o1" templateAlias are placed before buttons with the "o2" TemplateAlias, regardless of their sequence number.
As shown below the group “Actions” has 3 buttons, all with a TemplateAlias of o1. Therefore the buttons are rendered in sequence ( 10 -20 -30)
All buttons with a TemplateAlias of “o2” are rendered in sequence order (from smallest to largest) and each is displayed as a medium icon stacked in 3 rows as shown below:
All buttons with TemplateAlias of “o3” will be rendered after “o1” and “o2”. All buttons with TemplateAlias “o3” will be rendered in sequence order from smallest to largest.
If a TemplateAlias of “ISV” is used, the new button which you are adding will always be placed at the end of the group it is being added to.
If a button is added to a group and the sequence number given already exists, the button will not be visible. The Button must have a unique sequence value.