Tag Archives: ribbon

Dynamically Disable Ribbon Buttons in Dynamics CRM

Today I had to dynamically disable a custom Ribbon button.  My rule needed to be based on fields on the form and based on the form mode.  I only want the button enabled on the Update form and only when a certain checkbox is checked.

Here’s the steps.  These will work for CRM 2011 Ribbon buttons or CRM 2012 Command Bar buttons.

To modify the CRM Ribbon / Command Bar I use the excellent Ribbon Workbench tool from Develop 1.  To use this tool download their solution file, import it into CRM and then open the Solution.  The Ribbon Workbench UI will launch.  You will be prompted to open a solution.   For best performance it pays to create a temporary solution that contains just the entity you wish to customize and the JavaScript web resources you need to refer to (if applicable).

Here’s my custom Ribbon buttons as seen in Ribbon Workbench:

image

You add custom ribbon buttons by dragging a “Button” from the Toolbox in the bottom left corner of the screen up into the ribbon.   Then you set the Button properties through the Property window on the right and define the Button’s Command through the Solution Elements tab in the bottom middle of the screen.

Back to our dynamic rule.  First step is to define an Enable Rule.  This is done from the Solution Elements tab.  Right-click on Enable Rules and select Add New:

image

Click the arrow to expand Expand Rules, you will see a new Rule listed:

image

Right-click on the Rule and select Add Rule:

image

Up will pop a bunch of Rule types for you to pick from.  You can chose options here if you want your Button to be enabled only for certain form modes, or in say the Outlook Client but not the Web Client.   In my case I want to control the state of my button based on the results of a JavaScript function so I’m going to choose “Custom Javascript Rule”:

image

Next, click on the CustomRule and then complete the Properties on the right.  The important properties here are the Java Script Web Resource library (which will need to be contained in the Solution file you selected when Ribbon Workbench launched) and the FunctionName:

image

So, obviously, those properties need to match to an actual JavaScript function you have loaded into CRM via a Web Resource.  Here’s mine:

image

The JavaScript function can execute any logic you like, it just needs to return true or false.  A value of true will result in the Enabling of the button, false will Disable it.

One last bit, we need to add the Enable Rule to the Command tied to the Button.   This is also done from the Solution Elements tab.  I already had a Command defined so I just right-click on it and select Edit Enable Rules:

image

Up pops a Rule selector, simply select your rule and push it over to the right via the Add > button:

image

If you didn’t have a Command defined for your Button you would need to right-click on Commands in the Solution Elements tab and select Add New and then add the Enable Rule.  And you would need to select the Command you created back in the Button’s properties.

Last step is to Publish the changes:

image

And that’s it.  The approach for dynamically changing the display state of a button is almost identical so you are not an expert in that too.

Happy ribboning.

Oh and yes this is all the same in CRM 2013:

image

Advertisements

Adding Record Creation Buttons to the CRM 2011 Ribbon

I was recently asked how to move the Create New Case button from the Case ribbon to the Queue ribbon.   I was initially sceptical of this being possible, but after a little investigation found that in a roundabout way it is.

In this post I will demonstrate this approach but with a more widely applicable scenario – I will add a collection of quick create buttons to the Dashboard ribbon.  And I’ll demonstrate the process using the awesome new Visual Ribbon Editor from Erik Pool (thanks mate, you are a rock star!).

Here’s what we want to end up with:

image


Ok, so first thing to do is download the Visual Ribbon Editor from here.  The tool doesn’t need to be ‘installed’ as such.  I like to place the unzipped files on to my C drive and then create a desktop shortcut to the exe.   Launch the app and connect to your CRM instance using the first button on the menu:

image

And then click the 2nd button on the menu, and open the Case entity’s Ribbon definitions:

image 

By default the Case entity’s Form ribbon is displayed to you initially.  I want to look at the definition of the New button and that exists on the ribbon that displays above the Case view so from the menu change the Ribbon Type dropdown to Homepage:

image

Erik’s tool will now display a simulated version of the Case’s HomePageGrid ribbon (so cool!).  Click on the New button and you will see the definition of that button appear below:

image

Now, I want to recreate this button so initially I thought I would note the images defined here for the button and set my new button to use those.  But, the image used is the same for all entities so I would end up with a pretty dull looking ribbon if I did this:

image

So, instead I will find the individual entity images CRM uses and use those.  I will come back to that later.

Here, looking at the Case ribbon definition we want to determine the jscript function called by the button.  Click on the Action tab and then click the small arrows to expand what is displayed:

image

I originally thought I would see the button calling a CreateNewCase function.  Instead you will see Microsoft have designed a generic function that the new button on each entity can call passing in a unique entity identifier parameter to control which entity form is popped.

To replicate these buttons on the Dashboard ribbon we can call the same function and explicitly specify the entity identifier.  We are heading into unsupported territory here and there is a risk this solution won’t work after an upgrade but it’s an easy change to undo and if you needed to find an alternative approach in the future it wouldn’t be hard, this way is just the quickest.

Ok, now that we know what to do we need to switch to the Dashboard ribbon.  Click the Open button again and select Application Ribbons:

image

The Dashboard ribbon is then displayed by default:

image

So we can start making our edits.  Click the Create New Group button and then assign a unique ID to the new Group:

image

Click on the Title of the new group that appears on the simulated ribbon and then click the New Button button:

image

Give your new button a unique ID:

image

And then repeat to add additional buttons for each CRM record type you want to support.  By default the button group will be displaying your buttons as small buttons stacked vertically.  This is a bit ugly and we have plenty of space on the ribbon so select the button group and then change the Template to one that displays the buttons as large buttons:

image

And you should end up with a nice list of buttons:

image

Next step is to add the jscript call to each button.  For this we need to know the unique identifier of each entity.  For this, I downloaded and installed the MetaData Browser from here.  This is provided as a managed CRM solution so you import the file you download into CRM and then access the tool from within CRM.  With this tool you can easily search for your entities and locate their unique identifiers:

image

Ok, back to the Ribbon editor.  Click on the Case button and then select the Actions tab and add the following:

image

Repeat for each additional button, entering their unique identifier (Object Type Code from the Meta Data Browser) in as the Integer Parameter value.

Final step is to assign each button an image to pretty things up.  I want to use CRM’s standard images for each entity so I will go looking for those on the CRM Server.   These images can be found in your equivalent of the below folder:

C:\Program Files\Microsoft Dynamics CRM\CRMWeb\_imgs\Ribbon

Microsoft employs a consistent naming convention made up of an “Entity” prefix followed by the image size followed by the unique entity identifier.  So for my 5 entities (1,2,3,112, and 4212) I want the following files:

image

Now, we could grab these files and load them into CRM as web resources and then reference the web resources in our ribbon definitions but easier still is to just reference the files on the server in the same way that the standard ribbon buttons do (although this might need adjusting after an upgrade if Microsoft renames or moves those files).  Here’s what I entered for my new custom Case button:

image

Adding the image references for each of my remaining buttons has me ending up with this:

image

I click Save to update CRM:

image

And can then immediately see my new buttons appearing on the Dashboard ribbon:

image

A quick test, and yes they also work:

image

That’s it.  You could go on and add language translations and display rules for the buttons but I won’t go into that here.  To migrate this customisation to another environment simply include the Application Ribbons component in your Solution file.

If you would like a copy of this customisation I have a solution file available here.

Smile

How to view Ribbon Definitions in CRM 2011

Previously the SDK contained ribbon definition XML files in a folder at the following location:

\\sdk\samplecode\cs\client\ribbon\exportribbonxml\exportedribbonxml\

The latest SDK seems to no longer include these files.  So, now you need to generate these yourself using the utility provided.  It’s not hard to do, here’s the steps:

Go to this location:

\\sdk\samplecode\cs\client\ribbon\exportribbonxml\

Double-click the solution file (exportribbonxml.sln) to open this solution in Visual Studio.

Right-click on the Solution in Visual Studio and select Build:

image

Wait for that process to complete and make sure Visual Studio doesn’t report any errors.  If that all went ok you will now have an exe you can run, at the following location:

\\sdk\samplecode\cs\client\ribbon\exportribbonxml\bin\Debug\

Double click on the exe (ExportRibbonXml.exe) and then provide the details asked of you:

image

And that should generate the ribbon definition files that you need:

image

Working with Display Rules in CRM 2011–Ribbon Customisation

In this post I provide a quick guide on how to apply Display Rules to your custom ribbon buttons in Microsoft CRM 2011.

Firstly, here’s a quick run through on how to apply a Display Rule.

I have added a custom button to the Campaign form’s ribbon, as per below:

image

To add a display rule to limit when the button should appear I need to do 2 things:

1. Define the Display Rule

2. Assign the Display Rule to the button

To define the Display Rule we need to add the following to our customization.xml file:

image

This can be read as: 

“I want to define a new display rule called "GT.campaign.Form.Star.FormStateNotCreate.DisplayRule".  The rule is the button should only show if the form is not the Create form”.

And then to assign this rule to our button we simply reference the above ID in the Command Definition of our button:

image

Here’s a few more common Display Rule examples:

Display only on Create form:

            <DisplayRule Id="GT.campaign.Form.Star.FormStateCreate.DisplayRule">
              <FormStateRule State="Create" />
            </DisplayRule>

Display only on Update or Create form:

            <DisplayRule Id="GT.campaign.Form.Star.FormStateCreateOrUpdate.DisplayRule">
              <OrRule>
                <Or>
                  <FormStateRule State="Existing"/>
                </Or>
                <Or>
                  <FormStateRule State="Create"/>
                </Or>       
              </OrRule>
            </DisplayRule>

Do NOT display when Offline:

            <DisplayRule Id="GT.campaign.Form.Star.IsOffLine.DisplayRule">
            <CrmOfflineAccessStateRule
               Default="true"
               State="Online"  />
            </DisplayRule> 

Adding a new Button Group to the CRM Ribbon

Here’s a quick run through on how to add a new Group of buttons to the ribbon in Microsoft CRM 2011.

Here’s the end result that will be achieved:

image

In this scenario we are customising the Phone Call entity’s Form ribbon.  In particular the Main Tab of that ribbon (the tab that carries the name of the Entity).

To implement this change we need to customise the Phone Call entity.  At present CRM does not provide a UI for Ribbon customisations but the customisation XML does support these changes.  So we need the Phone Call entity’s customization xml.   Create a Solution, add the Phone Call entity, export the solution, unzip and then open the customization.xml file in Visual Studio.

Collapse the EntityInfo and FormXml nodes and you should see the RibbonDiffXml node, this is where we specify changes to the Ribbon.  Replace the CustomActions line with the following XML:

<CustomActions> 
  <CustomAction Id="Mscrm.Form.phonecall.CustomGroup.CustomAction" 
                Location="Mscrm.Form.phonecall.MainTab.Groups._children" 
                Sequence="110"> 
    <CommandUIDefinition> 
      <Group Id="Mscrm.Form.phonecall.CustomGroup.Group" 
              Command="Mscrm.Form.phonecall.CustomGroup.Command" 
              Title="Gareths Group" 
              Sequence="51" 
              Template="Mscrm.Templates.Flexible2"> 
        <Controls Id="Mscrm.Form.phonecall.CustomGroup.Controls"> 
          <Button Id="Mscrm.Form.phonecall.CustomGroup.Button.A" 
                  Command="Mscrm.Form.phonecall.CustomGroup.Button.A.Command" 
                  Sequence="10" 
                  LabelText="Button 1" 
                  ToolTipTitle="TipTitle" 
                  ToolTipDescription="TipDescription" 
                  TemplateAlias="o1" 
                  Image16by16="/_imgs/ribbon/newchart16.png"  
                  Image32by32="/_imgs/ribbon/newchart32.png"  /> 
          <Button Id="Mscrm.Form.phonecall.CustomGroup.Button.B" 
                  Command="Mscrm.Form.phonecall.CustomGroup.Button.B.Command" 
                  Sequence="20" 
                  LabelText="Button 2" 
                  ToolTipTitle="TipTitle" 
                  ToolTipDescription="TipDescription" 
                  TemplateAlias="o1" 
                  Image16by16="/_imgs/ribbon/CustomEntity_16.png"  
                  Image32by32="/_imgs/ribbon/CustomEntity_32.png"   /> 
        </Controls> 
      </Group> 
    </CommandUIDefinition> 
  </CustomAction> 
  <CustomAction Id="Mscrm.Form.phonecall.CustomGroup.MaxSize.CustomAction" 
                Location="Mscrm.Form.phonecall.MainTab.Scaling._children" 
                Sequence="120"> 
    <CommandUIDefinition> 
      <MaxSize  Id="Mscrm.Form.phonecall.CustomGroup.MaxSize" 
                GroupId="Mscrm.Form.phonecall.CustomGroup.Group" 
                Sequence="21" 
                Size="LargeLarge" /> 
    </CommandUIDefinition> 
  </CustomAction> 
  <CustomAction Id="Mscrm.Form.phonecall.CustomGroup.Popup.CustomAction" 
                Location="Mscrm.Form.phonecall.MainTab.Scaling._children" 
                Sequence="140"> 
    <CommandUIDefinition> 
      <Scale    Id="Mscrm.Form.phonecall.CustomGroup.Popup.1" 
                GroupId="Mscrm.Form.phonecall.CustomGroup.Group" 
                Sequence="85" 
                Size="Popup" /> 
    </CommandUIDefinition> 
  </CustomAction> 
</CustomActions>

We are adding 3 Custom Actions here: 

  • The first Custom Action adds the new Group and the 2 Buttons inside that Group.
  • The second Custom Action adds the MaxSize definition for the Group to the Scaling definition of the Ribbon.  This tells CRM how to display the buttons when the screen size does not require any collapsing of the buttons.
  • The third Custom Action adds the Scale definition for the Group to the Scaling definition of the Ribbon. This tells CRM how to display the buttons when the screen size is insufficient.

To adjust my sample code for your scenario do the following:

Do a Find and Replace on “phonecall”, replacing with the name of your entity.

Change the Location value on line 3 to the relevant Group ID of your entity’s Ribbon definition.  I’ll explain.  In my scenario I wanted to add a Button Group to the Phone Call form’s Main tab so I went and found the Phone Call ribbon definition in the SDK here:

  \sdk\samplecode\cs\client\ribbon\exportribbonxml\exportedribbonxml\phonecallribbon.xml

[UPDATE: 14 Dec 2011 – The latest SDK did not include the ribbon definition XML files forcing you to build and run an app from source code provided in order to generate them for your self. I provide instructions on this process here]

And looked for my Tab in that file, finding it here (see the yellow highlight below):

image

I wanted to add a new Group under the Groups section of the Ribbon so the Location value in our customization file needs to be that Groups Id (highlighted in green above) – appended with ._children.  i.e.:

image

That’s all you need to change at this stage.  We’ll come back and personalise other settings in a sec, let’s just try and get the button group to appear first.

Ok, now we need to add some commands to our customization file.  Replace the CommandDefinitions line with the following XML:

<CommandDefinitions> 
  <CommandDefinition Id="Mscrm.Form.phonecall.CustomGroup.Button.A.Command"> 
    <EnableRules /> 
    <DisplayRules /> 
    <Actions> 
      <Url Address="http://www.google.com" /> 
    </Actions> 
  </CommandDefinition> 
  <CommandDefinition Id="Mscrm.Form.phonecall.CustomGroup.Button.B.Command"> 
    <EnableRules /> 
    <DisplayRules /> 
    <Actions> 
      <Url Address="http://www.google.com" /> 
    </Actions> 
  </CommandDefinition> 
  <CommandDefinition Id="Mscrm.Form.phonecall.CustomGroup.Command"> 
    <EnableRules> 
      <EnableRule Id="Mscrm.ConvertActivity" /> 
    </EnableRules> 
    <DisplayRules> 
      <DisplayRule Id="Mscrm.ConvertActivity" /> 
    </DisplayRules> 
    <Actions /> 
  </CommandDefinition> 
</CommandDefinitions>

Here again we have 3 bits, 3 Command Definition’s:

  • The first Command Definition defines what should happen when the first button is clicked.  I just have a hardcoded URL being launched. 
  • The second Command Definition defines the 2nd button’s action.
  • And the third Command Definition defines when the Group of buttons should be enabled and visible.  You can alternatively set these rules per button.  You’ll see I am referring to a rule called “Mscrm.ConvertActivity”.   I got this from the phonecallribbon.xml.  This is the rule used for the Convert to Case button.  I find it’s handy to just steal the rule of another button who’s behaviour you want to mimic.

To adjust my sample code for your scenario do the following:

Change the URL being launched by each button or replace s jscript function call like the below:

image

And find a Display Rule and Enable Rule in your entity’s ribbon.xml that you can use.  You can’t just use my “Mscrm.ConvertActivity” rule as it may not exist on your entity.

Ok, that should be enough to get our buttons to appear.  To deploy, zip back up the customization.xml file along with it’s other solution files and then import that solution zip file back into CRM and Publish.  Pop your form and you should now see the new Button group and it’s 2 buttons:

image 

To adjust the appearance you can now go back and tweak some of the XML attributes (after which you would re-zip, import and publish).

To change where the Group appears on the Ribbon change the Sequence value under the Group node:

image

Refer back to the entity’s ribbon.xml to see what sequence each existing Group has to figure out what value you need to slot your in between:

image

Change the Button Group label and the label of the individual buttons here:

image

Change the Button icon here:

image

You have 2 approaches for setting the button icons.  You can browse the entity’s ribbon.xml (or any entity’s ribbon.xml for that matter, or even applicationribbon.xml) and steal the path and filename of a button you want to use.   Or, you can upload your own button icons as web resources and then reference the web resource, which is done in this manner:

Image16by16="$webresource:new_star16x16"  
Image32by32="$webresource:new_star32x32"

That should be enough to get you going.  Hope this helps someone.

Smile

Gareth.

Editing Ribbon Buttons in CRM 2011

In my previous posts I provide an introduction to working with the Ribbon in CRM 2011 where I demonstrate how to add and remove buttons.   In this post I will explain how to edit existing buttons.

Let’s start by framing an example.  On the Phone Call form we have Ribbon buttons for both “Convert to Case” and “Convert to Opportunity”:

image

You’ll note the poor Convert to Case button got the short straw and is presented as a small button, whilst the Convert to Opportunity button appears in full and with a text label.    But what if we are implementing CRM for Customer Service?  In that scenario we are unlikely to care about Opportunities and would likely prefer these buttons switched around.   Here’s how we do that…

As described in my previous posts customising the ribbon involves a bit of initial research and then some manual editing of an exported customization XML file.   For the research component what we need to do is have a look at the ribbon definition for the Phone Call form.  We find that in the SDK here:

\sdk\samplecode\cs\client\ribbon\exportribbonxml\exportedribbonxml\phonecallribbon.xml

[UPDATE: 14 Dec 2011 – The latest SDK did not include the ribbon definition XML files forcing you to build and run an app from source code provided in order to generate them for your self. I provide instructions on this process here]

Open that file in Visual Studio and locate the XML that represents these buttons we want to change.  In this case we want to find the form ribbon’s Main tab:

image

Always make sure you are looking at the right Tab as similarly named button may appear on the SubGrid tab and HomepageGrid tabs as well.

The lesson for first timers I want to reiterate here is DO NOT change this XML file.  It will have no effect.   This file is essentially documentation of the out-of-the-box CRM ribbons it is no way used by CRM to render the ribbons.   To change the ribbon we need to make entries into an exported customization.xml file that contains the definition of the Entity involved.

So jump back to CRM, create a Solution called PhoneCall and add the Phone Call entity into that Solution.  Export that Solution, unzip the file and then open customization.xml file in Visual Studio.  Collapse the EntityInfo and FormXml nodes and you should see the RibbonDiffXml node, this is where we specify changes to the Ribbon:

image

Replace the CustomActions line with the following XML:

<CustomActions> 
  <CustomAction Id="GT.switch.button.sequence1" 
                Location="Mscrm.Form.phonecall.MainTab.Convert.Controls._children" 
                Sequence="1"> 
    <CommandUIDefinition> 
      <Button Id="Mscrm.Form.phonecall.Convert.Opportunity"  
              Command="Mscrm.Form.ConvertToOpportunity"  
              Sequence="21"  
              Alt="$Resources:MenuItem_ToolTip_ConvertToOpportunity"  
              LabelText="$Resources:MenuItem_Label_ConvertToOpportunity"  
              Image16by16="/_imgs/ribbon/ConvertOpportunity_16.png"  
              Image32by32="/_imgs/ribbon/ConvertOpportunity_32.png"  
              ToolTipTitle="$Resources:Mscrm_Form_Other_MainTab_Actions_Convert_Opportunity_ToolTipTitle"  
              ToolTipDescription="$Resources:Mscrm_Form_Other_MainTab_Actions_Convert_Opportunity_ToolTipDescription"  
              TemplateAlias="o2"  
              /> 
    </CommandUIDefinition> 
  </CustomAction> 
  <CustomAction Id="GT.switch.button.sequence2" 
                Location="Mscrm.Form.phonecall.MainTab.Convert.Controls._children" 
                Sequence="2"> 
    <CommandUIDefinition>           
      <Button Id="Mscrm.Form.phonecall.Convert.Case"  
              Command="Mscrm.Form.ConvertToCase"  
              Sequence="9"  
              Alt="$Resources:MenuItem_ToolTip_ConvertToCase"  
              LabelText="$Resources:MenuItem_Label_ConvertToCase"  
              Image16by16="/_imgs/ribbon/ConvertCase_16.png"  
              Image32by32="/_imgs/ribbon/ConvertCase_32.png"  
              ToolTipTitle="$Resources:Mscrm_Form_Other_MainTab_Actions_Convert_Case_ToolTipTitle"  
              ToolTipDescription="$Resources:Mscrm_Form_Other_MainTab_Actions_Convert_Case_ToolTipDescription"  
              TemplateAlias="o1"  
              /> 
    </CommandUIDefinition> 
  </CustomAction> 
</CustomActions>

Here’s a breakdown of the XML…

This first bit:

image

Reads as:  “I want to perform a Custom Action, lets call my action GT.switch.button.sequence1.  I want to change one of the child nodes in the ribbon definition under the node that has the Id: “Mscrm.Form.phonecall.MainTab.Convert.Controls”.

Then we have:

image

Here we are defining a button.   Now what I did here was I copy and pasted the definition of the Convert to Opportunity button from phonecallribbon.xml into this customization.xml file.  I then changed the properties that I wanted changed.  Specifically I changed the Sequence so that this button would be rendered after the Convert to Case button (which has Sequence 20) and I changed the TemplateAlias to o2 so that this button will be rendered as a little button.   I think this is important as this button group has been defined as 1 big + 2 small button group and I don’t want to defy that.   Those are the only 2 items I have changed.  Because the Id I have specified for this button matches an existing button CRM knows to merge my definition with its existing definition and overwrite it’s definition with mine, rather than creating a new button.

In my XML snippet in addition to the above I have a second Custom Action containing a second button definition where I specify the overrides I want to the Convert to Case button.   Each button definition needs to sit under it’s own Custom Action header, hence this structure.

That’s it.  To deploy we simply zip back up the customization.xml file along with it’s other solution files and then import that solution zip file back into CRM and Publish.  

Here’s the end result:

image

You can follow this same approach to change buttons icons, button labels, etc.

Note: to retain both buttons as large buttons simply set TemplateAlias="o1" on each:

image

Hiding a Ribbon Button in CRM 2011

 

Scenario:  Removing the Qualify button from the Lead screens

i.e.:  Before:

image

and After:

image

 

There are 2 parts to customising the Ribbon:

1. Determine the ID of the ribbon component you want to change

2. Add a custom action to the relevant entity’s exported customisation file to ‘request’ a change to that ribbon component

 

To figure out the ID browse to the following SDK folder…

SampleCode\CS\Client\Ribbon\ExportRibbonXml\ExportedRibbonXml\

.. and have a look at the ribbon definition for the entity involved.  In our case this is the file  leadribbon.xml.

[UPDATE: 14 Dec 2011 – The latest SDK did not include the ribbon definition XML files forcing you to build and run an app from source code provided in order to generate them for your self. I provide instructions on this process here]

There are separate ribbon definitions for: the main grid view of an entity, the related grid view, and the form.  In our case these buttons appear on the main grid view and on the form but not on the related grid ribbon, so there are 2 changes we need to make.

Ribbons are defined as a collection of tabs.  Each tab has Groups.  Each Group has buttons.

The Tabs we are after and the Groups on those Tabs are as per below:

image

 

Now here’s the trap for young players, we don’t make changes to the leadribbon.xml.  It’s included in the SDK only as a reference.  Instead, we need to make our changes to the Lead entity itself by exporting and editing its customisation XML.   This is the second part of the 2-part process…

 

Here’s the steps:

1. Create a new Solution called LeadEntityOnly

2. Add the Lead entity to the Solution

3. Export the Solution and unzip it

4. Open the exported customisation.xml file in Visual Studio (or NotePad if you don’t have VS)

5. Do a FIND on <RibbonDiffXml>

6. Replace  <CustomActions /> with the below:

<CustomActions > 
  <HideCustomAction Location="Mscrm.HomepageGrid.lead.ConvertLead" 
                    HideActionId="Mscrm.HomepageGrid.lead.ConvertLead.HideAction" /> 
  <HideCustomAction Location="Mscrm.Form.lead.ConvertLead" 
                    HideActionId="Mscrm.Form.lead.ConvertLead.HideAction" />           
</CustomActions>

Note: the Location attributes refer to the Button ID’s I identified in the leadribbon.xml file

7. Save.

8. Re-zip

9. Import

10. Publish

11. Refresh your browser

 

Hope this helps Smile