MS Dynamics CRM 2011 :Ribbon Customization Part-1-Add a custom tab to Microsoft Dynamics CRM 2011 ribbon

If you need the basics on  Ribbon customization please check my earlier blog  MS Dynamics CRM 2011 :Ribbon Customization Part-1

Today  we will look at how to add a tab  and a custom button to the tab to the existing CRM 2011 ribbon

  1. Create a new Solution with the name ‘AddCustomTabSolution’
  2. Add the Exisitng’ApplicationRibbon’ to the above solution
  3. Save and Export the solution
  4. Unzip the Solution , Edit the Customization File.
  5. The open the customization file  it appears as below.  

<ImportExportXml xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance”&gt;

 <Entities></Entities>

 <Roles></Roles>

  <Workflows></Workflows>

  <FieldSecurityProfiles></FieldSecurityProfiles>

  <Templates />

  <RibbonDiffXml>

    <CustomActions />

    <Templates>

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

    </Templates>

    <CommandDefinitions />

    <RuleDefinitions>

      <TabDisplayRules />

      <DisplayRules />

      <EnableRules />

    </RuleDefinitions>

    <LocLabels />

  </RibbonDiffXml>

  <EntityMaps />

  <EntityRelationships />

  <OrganizationSettings />

  <optionsets />

  <Languages>

    <Language>1033</Language>

  </Languages>

</ImportExportXml>

6. Now our task is to add a Tab to the Ribbon . as from our earlier post we know that whatever we need to do(Add, Remove, Hide items) on the Ribbon we need to do under CustomActions

7. Adding a Custom Action By Specifying the CustomAction 

<CustomAction Id=”Mscrm.ISV.MyCustomTabAction” Location=”Mscrm.Tabs._children” Sequence=”1000″>
        <CommandUIDefinition>

          <Tab Id=”Mscrm.ISV.MyCustomTab” Command=”Mscrm.ISV.MyCustomTabCommand” Description=”Custom Tab” Title=”Custom Tab” Sequence=”1000″>

            <Scaling Id=”Mscrm.Isv.Global.Scaling”>

              <MaxSize Id=”Mscrm.Isv.Global.Group0.MaxSize” Sequence=”10″ GroupId=”Mscrm.Isv.Global.Group0″ Size=”Large” />

              <Scale Id=”Mscrm.Isv.Global.Group0.Scale.Medium” Sequence=”20″ GroupId=”Mscrm.Isv.Global.Group0″ Size=”Medium” />

              <Scale Id=”Mscrm.Isv.Global.Group0.Scale.Small” Sequence=”30″ GroupId=”Mscrm.Isv.Global.Group0″ Size=”Small” />

              <Scale Id=”Mscrm.Isv.Global.Group0.Scale.Popup” Sequence=”40″ GroupId=”Mscrm.Isv.Global.Group0″ Size=”Popup” />

            </Scaling>

            <Groups Id=”Mscrm.Isv.Global.Groups”>

              <Group Id=”Mscrm.Isv.Global.Group0″ Sequence=”10″ Command=”Mscrm.Isv.Global.Group0″ Title=”Custom Group1″ Description=”Custom Group1″ Template=”Mscrm.Templates.Flexible”>

              </Group>

            </Groups>

          </Tab>

        </CommandUIDefinition>

      </CustomAction>

8. Specify the Command Definition

<CommandDefinitions>

      <CommandDefinition Id=”Mscrm.ISV.MyCustomTabCommand”>

        <EnableRules />

        <DisplayRules>

          <DisplayRule Id=”Mscrm.ISV.MyCustomTabCommand” />

        </DisplayRules>

        <Actions />

      </CommandDefinition>

      <CommandDefinition Id=”Mscrm.Isv.Global.Group0″>

        <EnableRules />

        <DisplayRules />

        <Actions />

      </CommandDefinition>

      </CommandDefinitions>

9.   Specify the display Rule

<DisplayRule Id=”Mscrm.ISV.MyCustomTabAction”>

       <OrRule>

          <Or>

            <CrmClientTypeRule Type=”Web” />   

          </Or>

        </OrRule>

       </DisplayRule>

10.  Save the Customization file, Zip the Solution and import the Solution and Refresh the Web page you can see the Custom Tab with the Custom Button inside a Custom Group  and the ribbon now looks like as shown in the screenshot.

Adding a Custom Tab to MS CRM 2011



The entire customization file  can be Downloaded here .
Unmanaged Solution can be downloaded here

Advertisements

10 Responses to MS Dynamics CRM 2011 :Ribbon Customization Part-1-Add a custom tab to Microsoft Dynamics CRM 2011 ribbon

  1. Pingback: MS Dynamics CRM 2011 :Ribbon Customization Part-2-Understanding the Ribbon customization « Siva's Dynamics CRM 2011 Blog

  2. Pingback: Ribbon Customization-Part 3-Add a Custom Tab to a Specific Entity(Opportunity Entity) « Siva's Dynamics CRM 2011 Blog

  3. Pingback: Dynamics CRM 2011 Ribbon Customization Index « Siva's Dynamics CRM 2011 Blog

  4. Pingback: Ribbon Customization 12:Custom Ribbon Tab in CRM is now always selected « Siva's Dynamics CRM 2011 Blog

  5. I tried add and test this examples in my Dynamics CRM 2011 Online.

    Works property when i download the entire solution and Import to my CRM. The tab Group and Button appears in my Ribbon.

    But now i want to delete this Button, i tried delete the solution but the Ribbons continue with the Custom Button i was created. How i can back my Ribbon to how they was before ???

    tks and sure for my English.

    • I tried to add and test these examples on my 2011 Dynamics CRM Online.

      It worked properly when I downloaded the entire solution and Import to my CRM. The Group tab and button appear on my ribbon.

      But now I want to delete this button, I tried deleting the solution, but the ribbon has continued with the custom button I created. How can I return my ribbon as it was before?

      thanks and sorry for my English.

      • Hi Ricardo,
        Please download the solution file from this link and reimport it this removes the Custom tab as well as the custom button which came up after my solution installation.

        Thanks!
        Siva

  6. Louis says:

    Ok, I’ve tried this every way from Sunday and can’t get it to work.

    I’ve literally cut and pasted your code into the appropriate 3 sections.

    CustomAction in RibbonDiffXml | CustomActions
    CommandDefinition into RibbonDiffXml | CommandDefinitions
    DisplayRule into RibbonDiffXml | RuleDefinitions | DisplayRules

    I get an error that say “The element ‘Group’ has incomplete content.”, but the Schema validates fine in Visual Studio.

    This is driving me crazy. Editing Ribbons is by far the most incomplete feature in a released product I have ever seen. It shouldn’t be this hard to edit a bleeping tab…

    Sorry, had to get that off my chest.

    Any advice?

  7. Bishnu says:

    Hello,

    How can we do it in CRM 2013. I tried as same as your are showing here but it does not display any more. Could you give me some instruction? Very helpful your blog.

    Bishnu

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

%d bloggers like this: