Qualifying Leads Without Creating Opportunities

The standard Lead to Opportunity business process in Dynamics 365/CRM is perfect for many organisations. A lead comes in and if qualified it becomes an Opportunity for someone to work through and hopefully win. Qualifying a lead runs a process which creates an Account, a Contact and an Opportunity. However, this process doesn’t make sense for every company, especially if you have multiple layers of business development and sales. It can be helpful to see how many Contacts at a company are going on a journey with you which is very difficult with multiple leads not linked in any way. So, how do you go about qualifying leads without creating opportunities and just creating an Account and a Contact instead?

We can’t modify the existing process, but we can hide the ability to run that, and create a new process instead. First, make sure you remove the existing Business Process Flow which you can do by following the steps here. Now let’s create a new field on the lead entity called ‘Convert Lead’ using two options of Yes and No, with No being the default value. Add it to your Lead form just so you can use it for testing. You won’t need it on there once you’ve finished as it’s just going to be used as a trigger for some workflows. Make sure you have a section on the form to display the Account record and the Contact record that will be created once the Lead is Qualified.

Next, we are going to create two workflows, both of them real time so the user sees an immediate change. The first will allow a user to qualify the lead. The workflow will start when the Convert Lead field changes so our condition checks to make sure it is Yes. Our next step is to add an Action. Select QualifyLead from the list, then the Entity should be Leads. Click on Set Properties next.

Here is where we can define what happens when the Lead gets qualified. We want to make sure the CreateOpportunity property is set to False, and the CreateContact and CreateAccount are set to True. Save and Activate the workflow.

The second workflow will be used to change the Convert Lead field if a user reactivates the Lead record. This will have a simple condition which starts when the record status changes and checks to make sure the Lead is Open. If it is, the Convert Lead field will be changed back to No.

While users could run the first work flow on demand, we want them to have the same kind of experience they currently have when qualifying a lead and allow them to click a button. This means we need to use the Ribbon Workbench to make some changes. If you haven’t used it before, don’t be intimidated, but be sure to do this in your test environment first rather than jumping straight in! Good news, making the necessary changes needed is relatively straight forward. You can download the Ribbon Workbench from here and download the smart buttons you will need from here. Both of these solutions will need to be imported in to your D365 instance. I prefer to use the Ribbon Workbench directly within the XrmToolBox which you can download here. Please note, even if you use the XrmToolBox you will still need to import the smart buttons solution. Oh, and thanks to the lovely MVP Sarah Critchley for writing this post so that I could find it and even know about smart buttons. 😎

Now that you have that sorted, create a solution in your D365 instance which contains the Lead entity, and two icons to use for your new button. Open the solution in the Ribbon Workbench. Once open, you should see the Smart Button options available to add to the ribbon. Drag the Quick JS on to the Form area next to the default Qualify button.

Once you have dragged this over, the following window will open. Add in the following javascript, making sure to replace the attribute name with your own attribute name. When a user clicks on the button, it will set the Convert Lead button to Yes (value is 1). It will then save the form. Once the form saves, the first real time workflow will kick in to qualify the lead.

Xrm.Page.getAttribute(“az_converttolead”).setValue(1);
Xrm.Page.data.refresh(true);

Once you have clicked OK, you will be able to see the smart button properties. You can change the images and use the ones you added to your solution. Although you could use the out of the box Qualify Lead image, might be a good idea to use something different to show that it’s obviously custom to someone else who might need to make changes after you. You can also modify the label, tool tip title and tool tip description.

Once you have added it and changed your image it should look something like this. Right click on the default Qualify button and hide it so it isn’t confusing to the users.

From the Solution elements, click on the new command to see the properties. By adding the smart button it’s done all of this for you. Really slick and awesome right? 🙂 From the Display Rules section, click Add Display Rule.

Add in a ValueRule which determines when the button is displayed. We want to show the button by default but hide the button if the field value is Yes (1). Now click Publish to push the changes to your D365 instance.

Right, now test it out! Navigate to an unqualified Lead record. You should see your new Qualify Lead button, and the Convert Lead value is No. Click on the Qualify Lead button from the ribbon.

As soon as the button is clicked, the javascript jumps in to action. It changes the Convert Lead field value from No to Yes and saves the record. This then triggers the first workflow created which is creating the Account and the Contact record and changing the status of the lead to qualified. The display rule then means the Qualify Lead button is hidden, and only the Reactive Lead button is shown. If the Reactivate Lead button is used, this will change the Convert Lead field back to No, which will allow the Qualify Lead button to be displayed. And… No Opportunity is created! Yeah! 👍

While there are other ways to achieve this, these steps give you a no code solution to changing the standard Lead to Opportunity process in Dynamics 365 CRM making it a Lead to Account & Contact process instead. Hopefully this will help others who wish to achieve the same!

2 thoughts on “Qualifying Leads Without Creating Opportunities

  1. This is great, thanks Megan!
    We have just upgraded to D365 and had to have a consultant house make a difficult code solution to get this. This is awesome that we can now change it out with this!

    Great blog, thanks for the insights!

    1. Hi Vivian, thank you so much for taking the time to comment. This is exactly the reason I write articles like this, in the hopes that the examples I post will help others. While the Lead to Opportunity process is perfect for some organisations, having an Opportunity for each qualified Lead just doesn’t make any sense for others. Hope it works out well for you!

Leave a Reply

Your email address will not be published. Required fields are marked *