Dynamics CRM 2011 Ribbon Customization Index

Here I am listing the index for my posts For Ribbon Customization

Topic Link
Understanding the CRM 2011 Ribbon
https://dynamicscrm2011.wordpress.com/2011/04/05/ribbon-customization/
Adding a Custom Tab to the CRM 2011 ribbon ( for HomePageGrid., and this will display for all the entities—like a Custom ISV Tab)

https://dynamicscrm2011.wordpress.com/2011/04/12/ms-dynamics-crm-2011-ribbon-customization-part-i-add-a-custom-tab-to-microsoft-dynamics-crm-2011-ribbon/

Understanding the Ribbon Customization-Schemas of the Ribbon https://dynamicscrm2011.wordpress.com/2011/04/12/ms-dynamics-crm-2011-ribbon-customization-part-2-understanding-the-ribbon-customization/
Adding a Custom Tab to the Specific Entity ( i.e for opportunity entity) https://dynamicscrm2011.wordpress.com/2011/04/13/ribbon-customization-part-3-add-a-custom-tab-to-a-specific-entityopportunity-entity/
Adding a Custom Tab, Custom Group,Button to the Grid Ribbon of a specific entity (i.e for Opportunity Entity) https://dynamicscrm2011.wordpress.com/2011/04/27/ribbon-customization-part-4-add-a-custom-tab-custom-group-and-custom-buttons-to-a-specific-entityopportunity-entity/
Adding a Custom Tab, Custom Group,Button to the Form Ribbon and SubGrid Ribbon of a specific entity (i.e for Opportunity Entity) https://dynamicscrm2011.wordpress.com/2011/04/27/ribbon-customization-part-5-add-a-custom-tab-custom-group-and-custom-buttons-to-a-form-ribbon-for-a-specific-entityopportunity-entity/
Adding a  Custom Group,Button to the existing tab of a specific entity (i.e for Opportunity Entity) https://dynamicscrm2011.wordpress.com/2011/04/28/ribbon-customization-part-6-add-a-custom-group-and-custom-buttons-to-existing-tab-for-a-specific-entityopportunity-entity/
Hiding a Ribbon Button in CRM 2011 https://dynamicscrm2011.wordpress.com/2011/04/28/ribbon-customization-part-7-hiding-a-ribbon-button-in-dynamics-crm-2011/
Hiding a Group of Ribbon Buttons in CRM 2011 https://dynamicscrm2011.wordpress.com/2011/04/29/ribbon-customization-part-8-hiding-a-group-of-ribbon-buttons-in-dynamics-crm-2011/
Adding a Button to Existing Group for custom entity’s Ribbon in Dynamics CRM 2011 https://dynamicscrm2011.wordpress.com/2011/05/02/ribbon-customization-part-9-adding-a-button-to-existing-group-for-custom-entitys-ribbon-in-dynamics-crm-2011/
   
   
   
   
   
   
   
   
   

Ribbon Customization Part-9-Adding a Button to Existing Group for custom entity’s Ribbon in Dynamics CRM 2011

Today we will see how to add a button to the Entity Forms existing group for a custom entity

for the sake of doing this I created a custom entity with name “testcustomentity” and want to add a custom button under the “Save Group”

Follow the below steps to do the same

  1. Create a solution
  2. Create a new entity”testcustomentity” , Save
  3. publish and export the solution
  4. unzip the solution
  5. Edit the customization.xml
  6. Place the below code for the RibbonDiffXML
  7.    1: <RibbonDiffXml>

       2:        <CustomActions>

       3:          

       4:        

       5:        <CustomAction Id="Sample.testcustomentity.form.Save.CustomAction"

       6:                  Location="Mscrm.Form.new_testcustomentity.MainTab.Save.Controls._children"

       7:                  Sequence="80">

       8:          <CommandUIDefinition>

       9:            <Button Id="Sample.testcustomentity.form.Save.Button"

      10:                    Command="Sample.testcustomentity.form.Save.Command"

      11:                    LabelText="$LocLabels:Sample.testcustomentity.form.Save.LabelText"

      12:                    ToolTipTitle="$LocLabels:Sample.testcustomentity.form.Save.LabelText"

      13:                    ToolTipDescription="$LocLabels:Sample.testcustomentity.form.Save.ToolTip"

      14:                    TemplateAlias="o1"

      15:                    Image16by16="/_imgs/ribbon/AddEmail_16.png"

      16:                    Image32by32="/_imgs/ribbon/Email_32.png" />

      17:          </CommandUIDefinition>

      18:        </CustomAction>

      19:        </CustomActions>

      20:        <Templates>

      21:          <RibbonTemplates Id="Mscrm.Templates"></RibbonTemplates>

      22:        </Templates>

      23:        <CommandDefinitions>

      24:          <CommandDefinition Id="Sample.testcustomentity.form.Save.Command">

      25:            <EnableRules/>

      26:            <DisplayRules/>

      27:  

      28:            <Actions>

      29:              <JavaScriptFunction Library="$webresource:new_/ShowMessage.js" FunctionName="show">

      30:                <StringParameter Value="2" />

      31:              </JavaScriptFunction>

      32:            </Actions>

      33:          </CommandDefinition>

      34:        </CommandDefinitions>

      35:          

      36:        <RuleDefinitions>

      37:          <TabDisplayRules />

      38:          <DisplayRules />

      39:          <EnableRules />

      40:        </RuleDefinitions>

      41:        <LocLabels>

      42:          <LocLabel Id="Sample.testcustomentity.form.Save.LabelText">

      43:            <Titles>

      44:              <Title languagecode="1033"

      45:                      description="Custom Button1" />

      46:            </Titles>

      47:          </LocLabel>

      48:          <LocLabel Id="Sample.testcustomentity.form.Save.ToolTip">

      49:            <Titles>

      50:              <Title languagecode="1033"

      51:                      description="Custom Button1" />

      52:            </Titles>

      53:          </LocLabel>

      54:        </LocLabels>

      55:      </RibbonDiffXml>

  8. Save  the File
  9. Zip the Solution and Import it
  10. The result look like as shown in the below screenshot
  11. AddingacustombuttontoExsistingtabforacustomentity
  12. The complete solution can be downloaded here
  13. Happy learning.Smile

Ribbon Customization-Part 6-Add a Custom Group and Custom Buttons to Existing Tab for a Specific Entity(Opportunity Entity)

As we have seen how to add Custom Tab,Custom Group, Custom Buttons to Display on Entity Form, Sub Grids, in my earlier post, Today we will see how to add Custom Group and Custom Buttons to an existing tab for Opportunity Entity.

To day we will perform the following tasks

  1. We will add a Custom group with the Buttons in the Opportunities Tab(i.e Homepage Grid) for Opportunity  entity as shown in the below screenshot
  2. Adding Custom Buttons to Exsiting Tab in MSCRM 2011 ribbon Customization
  3. As usual create a new solution with the Opportunity entity, save and export it
  4. unzip the solution and Edit the “customizations.xml”
  5. As we need to add  a custom group to the existing tab we need to get the Id of the Tab and also the Group id where we want to place the new group. So for this we need to check the Opportunityribbon.xml which will be available under the folder \\ sdk\samplecode\cs\client\ribbon\exportribbonxml\exportedribbonxml\
  6. Opportunityribbon.xml will appear as shown in the below screenshot and we will add the custom group with buttons to the Home Page Grid main tab and the tab in which we are going to create a new group is  highlighted and also the group where we are creating a new group next to the group is also shown in the below screenshot
  7. OpportunityRibbonxml with groups
  8. I defined the customActions as shown in the below  code snippet
       1: <CustomAction Id="Sample.Grid.opportunity.CustomGroup.MaxSize.CustomAction" Location="Mscrm.HomepageGrid.opportunity.MainTab.Scaling._children" Sequence="150">

       2:             <CommandUIDefinition>

       3:               <MaxSize Id="Sample.Grid.opportunity.CustomGroup.MaxSize" GroupId="Sample.Grid.opportunity.CustomGroup.Group" Sequence="21" Size="LargeLarge" />

       4:             </CommandUIDefinition>

       5:           </CustomAction>

       6:           

       7:           <CustomAction Id="Sample.Grid.opportunity.CustomGroup.CustomAction" Location="Mscrm.HomepageGrid.opportunity.MainTab.Groups._children" Sequence="115">

       8:             <CommandUIDefinition>

       9:               <Group Id="Sample.Grid.opportunity.CustomGroup.Group" Command="Sample.Grid.opportunity.CustomGroup.Command" Title="$LocLabels:Sample.Grid.opportunity.CustomGroup.Title" Sequence="85" Template="Mscrm.Templates.3.3" >

      10:                 <Controls Id="Sample.Grid.opportunity.CustomGroup.Controls">

      11:                   <Button Id="Sample.Grid.opportunity.CustomGroup.Button.A" Command="Sample.Grid.opportunity.CustomGroup.Button.A.Command" Sequence="10" LabelText="$LocLabels:Sample.Grid.opportunity.CustomGroup.Button.A.LabelText" ToolTipTitle="$LocLabels:Sample.Grid.opportunity.CustomGroup.Button.A.LabelText" ToolTipDescription="$LocLabels:Sample.Grid.opportunity.CustomGroup.Button.A.Description" TemplateAlias="o1" Image16by16="/_imgs/ribbon/AddEmail_16.png" Image32by32="/_imgs/ribbon/Email_32.png" />

      12:                   <Button Id="Sample.Grid.opportunity.CustomGroup.Button.B" Command="Sample.Grid.opportunity.CustomGroup.Button.B.Command" Sequence="20" LabelText="$LocLabels:Sample.Grid.opportunity.CustomGroup.Button.B.LabelText" ToolTipTitle="$LocLabels:Sample.Grid.opportunity.CustomGroup.Button.B.LabelText" ToolTipDescription="$LocLabels:Sample.Grid.opportunity.CustomGroup.Button.B.Description" TemplateAlias="o1" Image16by16="/_imgs/ribbon/AddEmail_16.png" Image32by32="/_imgs/ribbon/Email_32.png" />

      13:                 </Controls>

      14:               </Group>

      15:             </CommandUIDefinition>

      16:           </CustomAction> 

      17:         </CustomActions>

  9. Added the corresponding CommandDefinition as shown in the below code snippet
  10.    1: <LocLabel Id="Sample.Grid.opportunity.CustomGroup.Button.A.Description">

       2:         <Titles>

       3:           <Title languagecode="1033" description="First Button Description" />

       4:         </Titles>

       5:       </LocLabel>

       6:       <LocLabel Id="Sample.Grid.opportunity.CustomGroup.Button.B.Description">

       7:         <Titles>

       8:           <Title languagecode="1033" description="Second Button Description" />

       9:         </Titles>

      10:       </LocLabel>

      11:       

      12:       <LocLabel Id="Sample.Grid.opportunity.CustomGroup.Title">

      13:         <Titles>

      14:           <Title languagecode="1033" description="First Group" />

      15:         </Titles>

      16:       </LocLabel>

      17:       <LocLabel Id="Sample.Grid.opportunity.CustomGroup.Button.A.LabelText">

      18:         <Titles>

      19:           <Title languagecode="1033" description="First Button" />

      20:         </Titles>

      21:       </LocLabel>

      22:       <LocLabel Id="Sample.Grid.opportunity.CustomGroup.Button.A.ToolTipDescription">

      23:         <Titles>

      24:           <Title languagecode="1033" description="First Button" />

      25:         </Titles>

      26:       </LocLabel>

      27:       <LocLabel Id="Sample.Grid.opportunity.CustomGroup.Button.B.LabelText">

      28:         <Titles>

      29:           <Title languagecode="1033" description="Second Button" />

      30:         </Titles>

      31:       </LocLabel>

      32:       <LocLabel Id="Sample.Grid.opportunity.CustomGroup.Button.B.ToolTipDescription">

      33:         <Titles>

      34:           <Title languagecode="1033" description="Second Button" />

      35:         </Titles>

      36:       </LocLabel>

  11. In total We have added the CustomActions   for Group and the Scaling for the group
  12. In the Group we created the buttons
  13. For buttons we have added the Command Definitions and Corresponding the Labels
  14. Zip the Solution and import it to CRM and navigate to opportunities  you can see the desired result
  15. Download the  Complete solution from here

Note:This post solution contains the customizations of the earlier post as well

Ribbon Customization-Part 5-Add a Custom Tab, Custom Group and Custom Buttons to a Form Ribbon, Grid Ribbon for a Specific Entity(Opportunity Entity)

In my earlier post we have seen how to add custom buttons to the Entity Gird Ribbon for opportunity entity in CRM 2011

Now we will see how to add the same buttons to Entity Form level ribbon  and Sub Grid Ribbon ( The Ribbon that will show when the Control is in the Sub grid with in the Opportunity Entity Form and also  Sub grids showing the Opportunity Associated view)

  1. Create a new Solution called ”OpportunityFormlevelRibbon”  then Add Opportunity entity, and any dependency objects  and also the web resource”ShowMessage.js” which we created in the earlier post and export it and save it in  the disk
  2. unzip the solutions and Edit the customizations.xml
  3. Add the below <<CustomActions>> in addition to the existing custom action
  4.    1: <!--CustomAction  for  Tab, group, buttons to display in Form-->

       2:          <CustomAction Id="Sample.Form.opportunity.CustomTab.CustomAction" Location="Mscrm.Tabs._children" Sequence="40">

       3:            <CommandUIDefinition>

       4:              <Tab Id="Sample.Form.opportunity.CustomTab" Command="Sample.Form.opportunity.CustomTab" Title="$LocLabels:Sample.opportunity.CustomTab.Title" Description="$LocLabels:Sample.opportunity.CustomTab.Description" Sequence="40">

       5:                <Scaling Id="Sample.Form.opportunity.CustomTab.Scaling">

       6:                  <MaxSize Id="Sample.Form.opportunity.CustomTab.FirstGroup.MaxSize" GroupId="Sample.Form.opportunity.CustomTab.FirstGroup" Sequence="10" Size="LargeMedium" />

       7:                </Scaling>

       8:                <Groups Id="Sample.Form.opportunity.CustomTab.Groups">

       9:                  <Group Id="Sample.Form.opportunity.CustomTab.FirstGroup" Command="Sample.Form.opportunity.FirstGroup" Sequence="10" Title="$LocLabels:Sample.opportunity.CustomTab.FirstGroup.Title" Template="Mscrm.Templates.3.3">

      10:                    <Controls Id="Sample.Form.opportunity.CustomTab.FirstGroup.Controls">

      11:                      <Button Id="Sample.Form.opportunity.CustomTab.FirstGroup.FirstButton" ToolTipTitle="$LocLabels:Sample.opportunity.CustomTab.FirstGroup.FirstButton.LabelText" ToolTipDescription="$LocLabels:Sample.opportunity.CustomTab.FirstGroup.FirstButton.ToolTipDescription" Command="Sample.Form.opportunity.FirstButton" Sequence="10" LabelText="$LocLabels:Sample.opportunity.CustomTab.FirstGroup.FirstButton.LabelText" Alt="$LocLabels:Sample.opportunity.CustomTab.FirstGroup.FirstButton.LabelText" Image16by16="/_imgs/ribbon/AddEmail_16.png" Image32by32="/_imgs/ribbon/Email_32.png" TemplateAlias="o1" />

      12:                      <Button Id="Sample.Form.opportunity.CustomTab.FirstGroup.SecondButton" ToolTipTitle="$LocLabels:Sample.opportunity.CustomTab.FirstGroup.SecondButton.LabelText" ToolTipDescription="$LocLabels:Sample.opportunity.CustomTab.FirstGroup.SecondButton.ToolTipDescription" Command="Sample.Form.opportunity.SecondButton" Sequence="20" LabelText="$LocLabels:Sample.opportunity.CustomTab.FirstGroup.SecondButton.LabelText" Alt="$LocLabels:Sample.opportunity.CustomTab.FirstGroup.SecondButton.LabelText" Image16by16="/_imgs/ribbon/AddEmail_16.png" Image32by32="/_imgs/ribbon/Email_32.png" TemplateAlias="o1" />

      13:                     

      14:                    </Controls>

      15:                  </Group>

      16:                </Groups>

      17:              </Tab>

      18:            </CommandUIDefinition>

      19:          </CustomAction>

      20:  

      21:          <!--CustomAction  for  Tab, group, buttons to display in  Form Subgrid-->

      22:          <CustomAction Id="Sample.SubGrid.opportunity.CustomTab.CustomAction" Location="Mscrm.SubGrid.opportunity.ContextualTabs._children" Sequence="40">

      23:            <CommandUIDefinition>

      24:              <Tab Id="Sample.SubGrid.opportunity.CustomTab" Command="Sample.SubGrid.opportunity.CustomTab" Title="$LocLabels:Sample.opportunity.CustomTab.Title" Description="$LocLabels:Sample.opportunity.CustomTab.Description" Sequence="500">

      25:                <Scaling Id="Sample.SubGrid.opportunity.CustomTab.Scaling">

      26:                  <MaxSize Id="Sample.SubGrid.opportunity.CustomTab.FirstGroup.MaxSize" GroupId="Sample.SubGrid.opportunity.CustomTab.FirstGroup" Sequence="10" Size="LargeMedium" />

      27:                </Scaling>

      28:                <Groups Id="Sample.SubGrid.opportunity.CustomTab.Groups">

      29:                  <Group Id="Sample.SubGrid.opportunity.CustomTab.FirstGroup" Command="Sample.SubGrid.opportunity.FirstGroup" Sequence="10" Title="$LocLabels:Sample.opportunity.CustomTab.FirstGroup.Title" Template="Mscrm.Templates.3.3">

      30:                    <Controls Id="Sample.SubGrid.opportunity.CustomTab.FirstGroup.Controls">

      31:                       <Button Id="Sample.SubGrid.opportunity.CustomTab.FirstGroup.FirstButton" ToolTipTitle="$LocLabels:Sample.opportunity.CustomTab.FirstGroup.FirstButton.LabelText" ToolTipDescription="$LocLabels:Sample.opportunity.CustomTab.FirstGroup.FirstButton.ToolTipDescription" Command="Sample.SubGrid.opportunity.FirstButton" Sequence="10" LabelText="$LocLabels:Sample.opportunity.CustomTab.FirstGroup.FirstButton.LabelText" Alt="$LocLabels:Sample.opportunity.CustomTab.FirstGroup.FirstButton.LabelText" Image16by16="/_imgs/ribbon/AddEmail_16.png" Image32by32="/_imgs/ribbon/Email_32.png" TemplateAlias="o1" />

      32:                      <Button Id="Sample.SubGrid.opportunity.CustomTab.FirstGroup.SecondButton" ToolTipTitle="$LocLabels:Sample.opportunity.CustomTab.FirstGroup.SecondButton.LabelText" ToolTipDescription="$LocLabels:Sample.opportunity.CustomTab.FirstGroup.SecondButton.ToolTipDescription" Command="Sample.SubGrid.opportunity.SecondButton" Sequence="20" LabelText="$LocLabels:Sample.opportunity.CustomTab.FirstGroup.SecondButton.LabelText" Alt="$LocLabels:Sample.opportunity.CustomTab.FirstGroup.SecondButton.LabelText" Image16by16="/_imgs/ribbon/AddEmail_16.png" Image32by32="/_imgs/ribbon/Email_32.png" TemplateAlias="o1" />                      

      33:                    </Controls>

      34:                  </Group>

      35:                </Groups>

      36:              </Tab>

      37:            </CommandUIDefinition>

      38:          </CustomAction>

  5. Add the below CommandDefinitions  for the above buttons, tab,group
  6.    1: <!--Command Definetions for  Tab, Group, Buttons under Form needs to be included here-->

       2:  

       3:    <CommandDefinition Id="Sample.Form.opportunity.FirstButton">

       4:      <EnableRules />

       5:      <DisplayRules />

       6:      <Actions>

       7:        <Url Address="http://www.microsoft.com"></Url>

       8:      </Actions>

       9:    </CommandDefinition>

      10:    <CommandDefinition Id="Sample.Form.opportunity.SecondButton">

      11:      <EnableRules />

      12:      <DisplayRules />

      13:      <Actions>

      14:        <JavaScriptFunction Library="$webresource:new_/ShowMessage.js" FunctionName="show">

      15:          <StringParameter Value="2" />

      16:        </JavaScriptFunction>

      17:      </Actions>

      18:    </CommandDefinition>

      19:    <CommandDefinition Id="Sample.Form.opportunity.FirstGroup">

      20:      <EnableRules>

      21:        <EnableRule Id="Mscrm.Enabled " />

      22:      </EnableRules>

      23:      <DisplayRules>

      24:        <DisplayRule Id="Mscrm.CanWriteOpportunity" />

      25:      </DisplayRules>

      26:      <Actions />

      27:    </CommandDefinition>

      28:    <CommandDefinition Id="Sample.Form.opportunity.CustomTab">

      29:      <EnableRules>

      30:        <EnableRule Id="Mscrm.Enabled " />

      31:      </EnableRules>

      32:      <DisplayRules>

      33:        <DisplayRule Id="Mscrm.CanWriteOpportunity" />

      34:      </DisplayRules>

      35:      <Actions />

      36:    </CommandDefinition>

      37:  

      38:    <!--Command Definetions for  Tab, Group, Buttons under Form's SubGrid needs to be included here-->

      39:    <CommandDefinition Id="Sample.SubGrid.opportunity.FirstButton">

      40:      <EnableRules />

      41:      <DisplayRules />

      42:      <Actions>

      43:        <Url Address="http://www.microsoft.com"></Url>

      44:      </Actions>

      45:    </CommandDefinition>

      46:    <CommandDefinition Id="Sample.SubGrid.opportunity.SecondButton">

      47:      <EnableRules />

      48:      <DisplayRules />

      49:      <Actions>

      50:        <JavaScriptFunction Library="$webresource:new_/ShowMessage.js" FunctionName="show">

      51:          <StringParameter Value="2" />

      52:        </JavaScriptFunction>

      53:      </Actions>

      54:    </CommandDefinition>

      55:    <CommandDefinition Id="Sample.SubGrid.opportunity.FirstGroup">

      56:      <EnableRules>

      57:        <EnableRule Id="Mscrm.Enabled " />

      58:      </EnableRules>

      59:      <DisplayRules>

      60:        <DisplayRule Id="Mscrm.CanWriteOpportunity" />

      61:      </DisplayRules>

      62:      <Actions />

      63:    </CommandDefinition>

      64:    <CommandDefinition Id="Sample.SubGrid.opportunity.CustomTab">

      65:      <EnableRules>

      66:        <EnableRule Id="Mscrm.Enabled " />

      67:      </EnableRules>

      68:      <DisplayRules>

      69:        <DisplayRule Id="Mscrm.CanWriteOpportunity" />

      70:      </DisplayRules>

      71:      <Actions />

      72:    </CommandDefinition>

      73:    

  7. Add the below Tabrules to display the tab in the Form context, Subgrid context, Subgrid context when showing in the associated view as well
  8.    1: <TabDisplayRule TabCommand="Sample.SubGrid.opportunity.CustomTab">

       2:             <EntityRule EntityName="opportunity" Context="SubGridStandard" />

       3:             <EntityRule EntityName="opportunity" Context="SubGridAssociated" />

       4:           </TabDisplayRule>

       5:           <TabDisplayRule TabCommand="Sample.Form.opportunity.CustomTab">

       6:             <EntityRule EntityName="opportunity" Context="Form" AppliesTo="PrimaryEntity" />

       7:           </TabDisplayRule>

  9. Now you can zip  and install the solution and you can the buttons appearing in the following places
    1. Entity Grid
    2. Entity Form
    3. Entity SubGrid
    4. on Opportunity Associated view as well
  10. You can Download the complete Solution from here.