Can a Web-to-Lead deduplication be FREE?
Yes, it can! It’s not the Ferrari model, but it will still take you a bit of the way and save you a lot of work in your day to day processing of leads.
Here’s the scenario!
When someone registers on your website, and indicate to you that they have some sort of interest, the salesforce web-to-lead functionality allows you to easily capture their details.
The dupe problem arrives when the same user later (a few minutes or weeks) again registers and is now interested in another product, or wants a call because he is ready to buy.
In many deduplication solutions out there, the dupe is being blocked! This might mean that you actually looses the information that the lead wants to buy, so what to do instead.
Let the lead enter you database, but make sure it is flagged as a dupe, so that you can react promptly but at the same time with the information that the lead is someone you already had contact with in the past.
You or your workflows, if you have automated the process, should be able to see, by e.g. looking at the Status, that the lead is a duplicate and you can then apply a different action to the new lead, i.e. merge the duplicates before you react to the enquiry.
See an sample sceenshot of new leads to follow up below:
How does it work?
Here are the basic steps.
1) Implement your web-to-lead form on your website (see the salesforce instructions for how to do this)
2) Create a Trigger for the new leads, and if a dupe is found set the status of the lead to e.g. “New Dupe Lead”.
Inspired by the FREE Duplicate Contact Trigger (http://sites.force.com/appexchange/listingDetail?listingId=a0N300000016cicEAA) by Force.com Labs we will create a Lead trigger to detect if a new Lead is a dupe.
The original Trigger:
if (contacts.isEmpty() == false) {
//c.LastName.addError(’Contact cannot be created - Contact already exists’);
c.LastName += ‘-dupe’;
}
}
}
-and our LeadDetector variant:
As you can see we do not reject the entry of the lead, as this may cause us to loose important information about what the lead wants; -we certainly do not want to miss out his enquiry on pricing after his first request for information.
Now, once an new dupe lead is entered the status is automatically changed to “New – Dupe Lead”
Agreed, the deduplication (identification of duplicates) is far from sophisticated, but you might be able to improve the process by your own by looking at company name, first name, last name, phone like it was done in the original Trigger.
You can of cause also complement this approach with our Entry Check solution, so that those leads which falls though the rudimentary check, can be caught when you review the new lead and following up on the enquiry.
Next, you want to be able to merge/convert the lead with as few clicks as possible. Notice the 2 new buttons on top of the Lead List view.
To create these 2 buttons using Visual Force and Apex classes, create a Controller Class: LeadMergeConvertController
public LeadMergeConvertController (ApexPages.StandardController stdController) {
this.myLead = (Lead)stdController.getRecord();
retUrl = ApexPages.currentPage();
}
public LeadMergeConvertController (ApexPages.StandardSetController stdSetController) {
this.myLeads = (List
retUrl = ApexPages.currentPage();
}
public PageReference retURL() {
return new PageReference(” + ApexPages.currentPage().getParameters().get(’retURL’) );
}
public PageReference MergeSelected() {
PageReference pageRef = this.retURL();
PageReference p = null;
try{
if(myLeads.size() == 0) {
ApexPages.addMessage(new ApexPages.message(ApexPages.severity.INFO,’No Leads Selected’));
pageRef=null;
}else if(myLeads.size() == 1) {
ApexPages.addMessage(new ApexPages.message(ApexPages.severity.INFO,’Select At Least 2 Leads to Merge’));
pageRef=null;
// Enable the 3 lines below and comment out the 2 lines above if you have installed DatTrim Entry Check
//System.Debug(’retURL= ‘+ retUrl.getUrl());
//System.Debug(’Host= ‘+ retUrl.getHeaders().get(’Host’));
//pageRef = new PageReference(’/apex/trimec__TRIM_DupeStatus_Lead_ViewAll?id=’ + myLeads[0].id);
}else if(myLeads.size() > 3) {
ApexPages.addMessage(new ApexPages.message(ApexPages.severity.INFO,’Select Max. 3 Leads to Merge’));
pageRef=null;
}else{ // Launch wizard
String myWizard = ‘/lead/leadmergewizard.jsp’;
String myHost = ”;
p = new PageReference(myHost + myWizard);
p.getParameters().put(’retURL’, ‘/’+ myLeads[0].id);
p.getParameters().put(’id’, myLeads[0].id);
p.getParameters().put(’goNext’, ‘Next’);
String cid = ”;
for (Lead l: myLeads){
if(cid==”){
cid = l.id;
}else{
cid += ‘&cid=’ + l.id;
}
}
p.getParameters().put(’cid’, cid);
p.setRedirect(true);
return p;
}
}catch(DmlException ex){
ApexPages.addMessages(ex);
pageRef=null;
}
return pageRef;
}
public PageReference ConvertSelected() {
PageReference pageRef = this.retURL();
PageReference p = null;
try{
if(myLeads.size() == 0) {
ApexPages.addMessage(new ApexPages.message(ApexPages.severity.INFO,’No Leads Selected’));
pageRef=null;
}else if(myLeads.size() > 1) {
ApexPages.addMessage(new ApexPages.message(ApexPages.severity.INFO,’Select one (1) lead to Convert’));
pageRef=null;
}else{ // Launch wizard
String myWizard=’/lead/leadconvert.jsp’;
String myHost = ”;
p = new PageReference(myWizard);
p.getParameters().put(’retURL’, ApexPages.currentPage().getParameters().get(’retURL’));
p.getParameters().put(’id’, myLeads[0].id);
p.setRedirect(true);
return p;
}
}catch(DmlException ex){
ApexPages.addMessages(ex);
pageRef=null;
}
return pageRef;
}
}
-and the Visual Force pages for each button:
LeadConvertSelected
LeadMergeSelected
Now all you have to do is to add the 2 buttons to the Custom Buttons and Links section on your Lead object and you are done.
Nice and easy, right?
A small solution that will save a lot of time, and make your lead management process more effective.
We hope you like it!
Enjoy
Datatrim!





