Posted on 4. February 2012

Re-arrange standard Ribbon Buttons by customising Ribbon Group

Ribbon Groups are sets of Ribbon controls that change their layout to fit the available window width. Buttons will change size and position as defined by the template and scale settings. If you need to move buttons around within a stanard group so that the buttons used most often are always visible, you must customise the whole group rather than just the individual buttons.

The Ribbon Workbench for CRM 2011 makes customising groups simple. The following video shows you how to:

1. Customise a Group
2. Move buttons around in the group
3. Move buttons between template locations
4. Add a menu item to an existing split button in the group

The tutorial assumes you have already installed the Ribbon Workbench as shown by this short video.

The resulting RibbonXml is:

 

<?xml version="1.0" encoding="utf-16"?>
<RibbonDiffXml xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <CustomActions>
    <CustomAction Id="demo.Mscrm.HomepageGrid.contact.MainTab.Management.CustomAction" Location="Mscrm.HomepageGrid.contact.MainTab.Groups._children" Sequence="10">
      <CommandUIDefinition>
        <Group Command="Mscrm.Enabled" Description="$Resources:Ribbon.HomepageGrid.MainTab.Management" Id="Mscrm.HomepageGrid.contact.MainTab.Management" Image32by32Popup="/_imgs/ribbon/newrecord32.png" Sequence="10" Template="Mscrm.Templates.FourOverflow" Title="$Resources:Ribbon.HomepageGrid.MainTab.Management">
          <Controls Id="Mscrm.HomepageGrid.contact.MainTab.Management.Controls">
            <Button Alt="$Resources:Ribbon.HomepageGrid.account.Record.Merge.MergeRecords" Command="Mscrm.HomepageGrid.contact.MergeRecords" Id="Mscrm.HomepageGrid.contact.MergeRecords" Image32by32="/_imgs/ribbon/MergeRecords_32.png" Image16by16="/_imgs/ribbon/MergeRecords_16.png" LabelText="$Resources:Ribbon.HomepageGrid.account.Record.Merge.MergeRecords" Sequence="10" TemplateAlias="isv" ToolTipTitle="$Resources:Ribbon.HomepageGrid.account.Record.Merge.MergeRecords" ToolTipDescription="$Resources:Ribbon.Tooltip.Merge" />
            <SplitButton Alt="$Resources:Ribbon.HomepageGrid.MainTab.Management.Delete" Command="Mscrm.HomepageGrid.DeleteSplitButtonCommand" Id="Mscrm.HomepageGrid.contact.DeleteMenu" Image32by32="/_imgs/Workplace/remove_32.png" Image16by16="/_imgs/ribbon/delete16.png" LabelText="$Resources:Ribbon.HomepageGrid.MainTab.Management.Delete" Sequence="15" TemplateAlias="o2" ToolTipTitle="$Resources:Mscrm_HomepageGrid_Other_MainTab_Management_Delete_ToolTipTitle" ToolTipDescription="$Resources(EntityPluralDisplayName):Ribbon.Tooltip.Delete">
              <Menu Id="Mscrm.HomepageGrid.contact.DeleteMenu.Menu">
                <MenuSection Id="Mscrm.HomepageGrid.contact.DeleteMenu.MenuSection" Sequence="10" DisplayMode="Menu16">
                  <Controls Id="Mscrm.HomepageGrid.contact.DeleteMenu.Controls">
                    <Button Command="demo.contact.DeleteSomething.Command" Id="demo.contact.Button1.Button" Image16by16="$webresource:new_Image16.png" LabelText="$LocLabels:demo.contact.Button1.Button.LabelText" Sequence="30" />
                    <Button Alt="$Resources:Ribbon.HomepageGrid.MainTab.Management.Delete" Command="Mscrm.DeleteSelectedRecord" Id="Mscrm.HomepageGrid.contact.Delete" Image32by32="/_imgs/Workplace/remove_32.png" Image16by16="/_imgs/ribbon/delete16.png" LabelText="$Resources:Ribbon.HomepageGrid.MainTab.Management.Delete" Sequence="50" ToolTipTitle="$Resources:Mscrm_HomepageGrid_Other_MainTab_Management_Delete_ToolTipTitle" ToolTipDescription="$Resources(EntityPluralDisplayName):Ribbon.Tooltip.Delete" />
                    <Button Command="Mscrm.HomepageGrid.BulkDelete" Id="Mscrm.HomepageGrid.contact.BulkDelete" Image32by32="/_imgs/ribbon/BulkDeleteWizard_32.png" Image16by16="/_imgs/ribbon/BulkDeleteWizard_16.png" LabelText="$Resources:Ribbon.HomepageGrid.MainTab.Management.BulkDelete" Sequence="100" ToolTipTitle="$Resources:Ribbon.HomepageGrid.MainTab.Management.BulkDelete" ToolTipDescription="$Resources:Ribbon.HomepageGrid.MainTab.Management.BulkDelete.TooltipDescription" />
                  </Controls>
                </MenuSection>
              </Menu>
            </SplitButton>
            <Button Alt="$Resources:Ribbon.HomepageGrid.MainTab.Management.Edit" Command="Mscrm.EditSelectedRecord" Id="Mscrm.HomepageGrid.contact.Edit" Image32by32="/_imgs/ribbon/edit32.png" Image16by16="/_imgs/ribbon/Edit_16.png" LabelText="$Resources:Ribbon.HomepageGrid.MainTab.Management.Edit" Sequence="20" TemplateAlias="o1" ToolTipTitle="$Resources:Ribbon.HomepageGrid.MainTab.Management.Edit" ToolTipDescription="$Resources(EntityDisplayName):Ribbon.Tooltip.Edit" />
            <Button Alt="$Resources:Ribbon.HomepageGrid.MainTab.New" Command="Mscrm.NewRecordFromGrid" Id="Mscrm.HomepageGrid.contact.NewRecord" Image32by32="/_imgs/ribbon/newrecord32.png" Image16by16="/_imgs/ribbon/NewRecord_16.png" LabelText="$Resources:Ribbon.HomepageGrid.MainTab.New" Sequence="30" TemplateAlias="o1" ToolTipTitle="$Resources:Ribbon.HomepageGrid.MainTab.New" ToolTipDescription="$Resources(EntityDisplayName):Ribbon.Tooltip.New" />
            <Button Alt="$Resources:Ribbon.HomepageGrid.account.Record.Status.Deactivate" Command="Mscrm.HomepageGrid.Deactivate" Id="Mscrm.HomepageGrid.contact.Deactivate" Image32by32="/_imgs/ribbon/Deactivate_32.png" Image16by16="/_imgs/ribbon/deactivate16.png" LabelText="$Resources:Ribbon.HomepageGrid.account.Record.Status.Deactivate" Sequence="40" TemplateAlias="o2" ToolTipTitle="$Resources:Ribbon.HomepageGrid.account.Record.Status.Deactivate" ToolTipDescription="$Resources(EntityPluralDisplayName):Ribbon.Tooltip.Deactivate" />
            <Button Alt="$Resources:Ribbon.HomepageGrid.account.Record.Status.Activate" Command="Mscrm.HomepageGrid.Activate" Id="Mscrm.HomepageGrid.contact.Activate" Image32by32="/_imgs/ribbon/Activate_32.png" Image16by16="/_imgs/ribbon/Activate_16.png" LabelText="$Resources:Ribbon.HomepageGrid.account.Record.Status.Activate" Sequence="50" TemplateAlias="o2" ToolTipTitle="$Resources:Ribbon.HomepageGrid.account.Record.Status.Activate" ToolTipDescription="$Resources(EntityPluralDisplayName):Ribbon.Tooltip.Activate" />
            <FlyoutAnchor Alt="$Resources:Ribbon.HomepageGrid.account.Record.Dupe.Detect" Command="Mscrm.HomepageGrid.DetectDupes" Id="Mscrm.HomepageGrid.contact.Detect" Image16by16="/_imgs/ribbon/DetectDuplicates_16.png" Image32by32="/_imgs/ribbon/DuplicateDetection_32.png" LabelText="$Resources:Ribbon.HomepageGrid.account.Record.Dupe.Detect" Sequence="60" TemplateAlias="o3" ToolTipTitle="$Resources:Ribbon.HomepageGrid.account.Record.Dupe.Detect" ToolTipDescription="$Resources(EntityPluralDisplayName):Ribbon.Tooltip.DetectDuplicates">
              <Menu Id="Mscrm.HomepageGrid.contact.Detect.Menu">
                <MenuSection Id="Mscrm.HomepageGrid.contact.Detect.MenuSection" Sequence="10" DisplayMode="Menu16">
                  <Controls Id="Mscrm.HomepageGrid.contact.Detect.Controls">
                    <Button Alt="$Resources:Ribbon.HomepageGrid.account.Record.Dupe.Detect.Selected" Command="Mscrm.HomepageGrid.DetectDupesSelected" Id="Mscrm.HomepageGrid.contact.Detect.Selected" Image32by32="/_imgs/ribbon/DeleteSelected_32.png" Image16by16="/_imgs/ribbon/DeleteSelected_16.png" LabelText="$Resources:Ribbon.HomepageGrid.account.Record.Dupe.Detect.Selected" Sequence="10" ToolTipTitle="$Resources:Mscrm_HomepageGrid_Other_MainTab_Management_Detect_Selected_ToolTipTitle" ToolTipDescription="$Resources:Mscrm_HomepageGrid_Other_MainTab_Management_Detect_Selected_ToolTipDescription" />
                    <Button Alt="$Resources:Ribbon.HomepageGrid.account.Record.Dupe.Detect.All" Command="Mscrm.HomepageGrid.DetectDupesAll" Id="Mscrm.HomepageGrid.contact.Detect.All" Image32by32="/_imgs/ribbon/DetectAll_32.png" Image16by16="/_imgs/ribbon/DetectAll_16.png" LabelText="$Resources:Ribbon.HomepageGrid.account.Record.Dupe.Detect.All" Sequence="20" ToolTipTitle="$Resources:Mscrm_HomepageGrid_Other_MainTab_Management_Detect_All_ToolTipTitle" ToolTipDescription="$Resources(EntityDisplayName):Mscrm_HomepageGrid_EntityLogicalName_MainTab_Management_Detect_All_ToolTipDescription" />
                  </Controls>
                </MenuSection>
              </Menu>
            </FlyoutAnchor>
          </Controls>
        </Group>
      </CommandUIDefinition>
    </CustomAction>
    <CustomAction Id="demo.Mscrm.HomepageGrid.contact.MainTab.Management.MaxSize.CustomAction" Location="Mscrm.HomepageGrid.contact.MainTab.Scaling._children" Sequence="10">
      <CommandUIDefinition>
        <MaxSize GroupId="Mscrm.HomepageGrid.contact.MainTab.Management" Id="Mscrm.HomepageGrid.contact.MainTab.Management.MaxSize" Sequence="10" Size="LargeMediumLargeMedium" />
      </CommandUIDefinition>
    </CustomAction>
    <CustomAction Id="demo.Mscrm.HomepageGrid.contact.MainTab.Management.Scale.1.CustomAction" Location="Mscrm.HomepageGrid.contact.MainTab.Scaling._children" Sequence="130">
      <CommandUIDefinition>
        <Scale GroupId="Mscrm.HomepageGrid.contact.MainTab.Management" Id="Mscrm.HomepageGrid.contact.MainTab.Management.Scale.1" Sequence="130" Size="LargeMediumLargeMedium" />
      </CommandUIDefinition>
    </CustomAction>
    <CustomAction Id="demo.Mscrm.HomepageGrid.contact.MainTab.Management.Scale.2.CustomAction" Location="Mscrm.HomepageGrid.contact.MainTab.Scaling._children" Sequence="170">
      <CommandUIDefinition>
        <Scale GroupId="Mscrm.HomepageGrid.contact.MainTab.Management" Id="Mscrm.HomepageGrid.contact.MainTab.Management.Scale.2" Sequence="170" Size="Popup" />
      </CommandUIDefinition>
    </CustomAction>
  </CustomActions>
  <Templates>
    <RibbonTemplates Id="Mscrm.Templates" />
  </Templates>
  <CommandDefinitions>
    <CommandDefinition Id="demo.contact.DeleteSomething.Command">
      <EnableRules />
      <DisplayRules />
      <Actions>
        <Url Address="about:blank" WinMode="1" />
      </Actions>
    </CommandDefinition>
  </CommandDefinitions>
  <RuleDefinitions>
    <TabDisplayRules />
    <DisplayRules />
    <EnableRules />
  </RuleDefinitions>
  <LocLabels>
    <LocLabel Id="demo.contact.Button1.Button.LabelText">
      <Titles>
        <Title description="Delete Something" languagecode="1033" />
      </Titles>
    </LocLabel>
  </LocLabels>
</RibbonDiffXml>

Watch out for an upcomming tutorial on creating new tabs and changing the scaling behaviour of groups. I hope you agree that using the Ribbon Workbench can shave hours off of your development time when customising the CRM2011 Ribbon!

The Ribbon Workbench for CRM 2011 is a free download.

If you find an issue with the Ribbon Workbench for Dynamics CRM 2011 or have any suggestions, please send it here

Happy Ribbon Customising!

 

Comments are closed