- Go to Settings -> Customization -> Solutions.
- Click ‘New’ button on Solutions page.
- Fill up Display Name, Name, Publisher and Version as shown in the below figure and click ‘Save’.
- Select ‘Entities’ and click ‘Add Existing’. A popup window will come out and choose any one of the entities to which you want to add the ribbon button. I will choose ‘Case’ entity here.
- We will add the icons (16×16 and 32×32) to be used for the ribbon icon. Choose ‘Web Resources’ and click ‘New’ button as shown in the figure.
- Fill up Name, Display Name, Type and upload the icon file as shown in the figure and click ‘Save and Close’.
- Repeat the step no.6, and upload 32×32 icon file with the file name of ‘btn_dialog32’.
- Add another web resource and fill up Name, Display Name, Type and click ‘Text Editor’ as shown in the figure.
- Write java script as shown in the figure.
- Now you will see there are two icons and one java script in your web resources. Click ‘Save and Close’.
- Select the solution you have created just now and click ‘Export’. When the system prompts the dialog, click ‘Publish All Customizations’ button and after that, click ‘Next’ button.
(You need to export the solution you created so that you can add your customized ribbon button.)
- The exported file is saved as in the form of zip file. Find the zip file and extract it. There is a file called ‘customizations.xml’. Open the file and look for <RibbonDiffXml> tag in order to edit it.
- Replace existing <RibbonDiffXml> section with the following:
<CustomAction Id=”CI_formlevelHelloRibbonButton” Location=”Mscrm.Form.incident.MainTab.Actions.Controls._children” Sequence=”99″>
<Button Id=”B_formbuttonHelloRibbonButton” Command=”Cmd_DialogHelloRibbonButton”
LabelText=”Hello Ribbon” ToolTipTitle=”Hello Ribbon Button” ToolTipDescription=”This is my first ribbon button.” TemplateAlias=”o1″
<EnableRule Id=”Mscrm.Enabled” />
- After that, Go to Service -> Cases and open one of the cases. You will see a new ribbon button on the case form. When you click that ribbon button, you will see the message as shown in the figure.