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
Advertisements

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

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

  2. ericsstollc says:

    How did you determine the value for the CustomAction.Location attribute?

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: