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.
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:
ToolTipTitle="Qualify the Lead"
ToolTipDescription="Qualify the current Lead"
Also, replace <CommandDefinitions /> with the following:
Do observe that the two images we’ve loaded for the button are in fact:
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:
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: