Add button in existing group of Ribbon

Let’s say, we want to add a custom button in Activity group of Contact and on click it will open a window to create CustomerVisits (new_customervisit) record which is a custom activity.

Steps:
Follow the below steps to create a button in existing group.
Step #1 Create a new solution say TestSolution.
Step #2 Open newly created TestSolution and the entity on which you want to button.I have added contact entity.
Step #3 Publish All Customization
Step #4 Export the TestSolution for editing.
Step #5 Open customization.xml file from exported solution for editing.
Step #6 Find out RibbonDiffXml tag and replace the code from <RibbonDiffXml> to </RibbonDiffXml>With below code.

 

<RibbonDiffXml>

<CustomActions>

<CustomAction Id=”CompanyName.Form.contact.Related.Activities.CustomerVisits.CustomAction” Location=”Mscrm.Form.contact.Related.Activities.Controls._children” Sequence=”41″>

<CommandUIDefinition>

<Button Id=”CompanyName.Form.contact.Related.Activities.CustomerVisits” Command=”CompanyName.Form.contact.Related.Activities.CustomerVisits.Command” Sequence=”15″ ToolTipTitle=”$LocLabels:CompanyName.Form.contact.Related.Activities.CustomerVisits.LabelText” LabelText=”$LocLabels:CompanyName.Form.contact.Related.Activities.CustomerVisits.LabelText” ToolTipDescription=”$LocLabels:CompanyName.Form.contact.Related.Activities.CustomerVisits.Description” TemplateAlias=”isv” Image32by32=”http://<crm&gt;:5555/PuneCRMTest/WebResources/new_customerVisits” Image16by16=”http://<crm&gt;:5555/PuneCRMTest/WebResources/new_AppAdd” />

</CommandUIDefinition>

</CustomAction>

</CustomActions>

<Templates>

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

</Templates>

<CommandDefinitions>

<CommandDefinition Id=”CompanyName.Form.contact.Related.Activities.CustomerVisits.Command”>

<EnableRules />

<DisplayRules />

<Actions>

<Url Address=”http://<crm&gt;:5555/PuneCRMTest/main.aspx?etn=new_customervisit&amp;pagetype=entityrecord” PassParams=”false” WinParams=”0″ />

</Actions>

</CommandDefinition>

</CommandDefinitions>

<RuleDefinitions>

<TabDisplayRules />

<DisplayRules />

<EnableRules />

</RuleDefinitions>

<LocLabels>

<LocLabel Id=”CompanyName.Form.contact.Related.Activities.CustomerVisits.Description”>

<Titles>

<Title languagecode=”1033″ description=”CustomerVisits Description” />

</Titles>

</LocLabel>

<LocLabel Id=”CompanyName.Form.contact.Related.Activities.CustomerVisits.LabelText”>

<Titles>

<Title languagecode=”1033″ description=”CustomerVisits” />

</Titles>

</LocLabel>

</LocLabels>

</RibbonDiffXml>


Step #7 Save the customization.xml file.
Step #8 Zip the all three files (cutomiztion, solution and [Content_Types]) and import into CRM
Step #9 Remove the contact entity from TestSolution.
Step #10 Delete the solution TestSolution.

Author: Arvind Singh

Solution Architect with 15+ years of exp. Dynamics CRM, Power Platform, Azure which includes Solution, Design, Development, Deployment, Maintenance and support experience.

Leave a Reply

Please log in using one of these methods to post your comment:

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 )

Connecting to %s

%d bloggers like this: