Adding a new ribbon button (Qualify Lead)

This is a continuation of a previous post, where we removed the Qualify button from the Lead entity. This time we will be adding our own custom button.

Start by digging through the SDK. If you don’t have it, get it from HERE.

At the following path we’ll find the definitions for all the ootb entities:


look for the one related to Leads (leadribbon.xml).

In the <Ribbon> element you will the definitions for Tabs > Tab. We are looking for the Form’s main tab

<Tab Id=”Mscrm.Form.lead.MainTab” …

Identify the group you want to place your new button into, and copy the control ID for one of the other controls in that group. In my case, I want to place the new Qualify button in the Actions group.


with this piece of info on hand, let’s go to the solution that includes the Lead entity, and add the two images we need for the button. These are two .png images, one 16×16, the other 32×32. Also, if you don’t have a JavaScript resource added, add it now. You will be able to call a JS function with this button.

Export the solution, and unzip it. Open up customizations.xml and look for the Lead entity section. In the <CustomActions></CustomActions>, where we added the HideCustomAction elements in the previous post, add right underneath those two the following code:

<CustomAction Id="Nav.lead.Form.QualifyLead.CustomAction"
            Sequence="1" >          
                <Button Id="Nav.lead.Form.QualifyLead.Button"
                    ToolTipTitle="Qualify the Lead"
                    ToolTipDescription="Qualify the current Lead"

Also, replace <CommandDefinitions /> with the following:

            <CommandDefinition Id="Nav.lead.Form.QualifyLead.Command">
<JavaScriptFunction Library="$webresource:Nav_JS_Common_Lib"

Do observe that the two images we’ve loaded for the button are in fact:

  • nav_btn_qualify16
  • nav_btn_qualify_32

and the JS resource is Nav_JS_Common_Lib. The function we are calling is launchWorkflow and for the purpose of testing we can add the following function in our resource library:

function launchWorkflow()
alert("From within launchWorkflow JS function!");

That’s it, now re-package the solution, and load it back. Test it by going to a Lead, and clicking the new Qualify ribbon button.


You will get the following pop-up:



One thought on “Adding a new ribbon button (Qualify Lead)

Add yours

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your 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

Create a website or blog at

Up ↑

%d bloggers like this: