Ribbon Customization-Part 3-Add a Custom Tab to a Specific Entity(Opportunity Entity)

In this post we will see how to add a custom tab to specific entity. I am choosing to add a Custom Tab with name “myCustomTab” to the “Opportunity” Entity

  1. Create a new solution and add the opportunity entity  save and export the solution
  2. Unzip the solution and open the customization file in visual studio
  3. Make sure that you enable the Intellisense  for visual studio 2010 to edit the xml files as discussed in my earlier post
  4. AS the customization file consists of the entire entity we need to find out where the RibbonDiffXML. you can see <RibbonDiffXml> by minimizing the <FormXml> as shown in the below screenshot

 Oppotunity-Adding a Custom Tab Dynamics CRM 2011

5.       To understand  the structure of the Ribbon available for Opportunity entity SDK has given  all entity ribbon xmls  and you can find out at sdk\samplecode\cs\client\ribbon\exportribbonxml\exportedribbonxml\    and you can select the “opportunityribbon.xml” in the Visual studio.

6.        Understand how the existing tabs has been created in the “opportunityribbon.xml” and refer my earlier posts for better understanding on Ribbon customization.

  1.  
    1. MS Dynamics CRM 2011 :Ribbon Customization Part-1-Add a custom tab to Microsoft Dynamics CRM 2011 ribbon
    2. MS Dynamics CRM 2011 :Ribbon Customization Part-2-Understanding the Ribbon customization

7.        The <RibbonDiffXml> in the Opportunity entity appears as below

   <RibbonDiffXml>

        <CustomActions>

          <CustomAction Id =”Mscrm.Isv.GlobalCustomAction” Location=”Mscrm.Tabs._children” Sequence=”500″ Title=”myCustomAction” >

            <CommandUIDefinition>

              <Tab Id=”Mscrm.HomepageGrid.opportunity.CustomTab” Command=”Mscrm.HomepageGrid.opportunity.CustomTab” Title=”myCustomTab” Description=”myCustomTab” Sequence=”300″>

                <Scaling Id=”Mscrm.HomepageGrid.opportunity.CustomTab.Scaling”>

                  <MaxSize Id=”Mscrm.HomepageGrid.opportunity.CustomTab.CustomGroup.MaxSize” GroupId=”Mscrm.HomepageGrid.opportunity.CustomTab.CustomGroup” Sequence=”20″ Size=”LargeMedium” />

                  <Scale Id=”Mscrm.HomepageGrid.opportunity.CustomTab.CustomGroup.Scale.1″ GroupId=”Mscrm.HomepageGrid.opportunity.CustomTab.CustomGroup” Sequence=”120″ Size=”LargeSmall” />

                  </Scaling>

                <Groups Id=”Mscrm.HomepageGrid.opportunity.CustomTab.Groups”>

                </Groups>

              </Tab>            

            </CommandUIDefinition>                     

          </CustomAction>         

        </CustomActions>

         <Templates>

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

        </Templates>

        <CommandDefinitions/>        

        <RuleDefinitions>

          <TabDisplayRules>

            <TabDisplayRule TabCommand =”Mscrm.HomepageGrid.opportunity.CustomTab” >

              <EntityRule AppliesTo =”SelectedEntity”  EntityName =”opportunity” Context =”HomePageGrid”/>

            </TabDisplayRule>

          </TabDisplayRules>          

          <DisplayRules/>         

          <EnableRules />

        </RuleDefinitions>

        <LocLabels/>       

      </RibbonDiffXml>

      8.        The end Result is as shown in the below screenshot 

      AddingCustomTab toOpportunity-CRM 2011

9.        Download the unmanaged solution from here

Advertisements

One Response to Ribbon Customization-Part 3-Add a Custom Tab to a Specific Entity(Opportunity Entity)

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

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: