I am trying to convert a Lead and I am getting a blocking error from DupeBlocker stating that the new Account is being blocked due to a matching Lead by one of my Lead to Account scenarios. The problem is there is no other matching Lead for the new Account so I don't understand why the conversion is being blocked?
This can happen if there is a Lead to Account Scenario with the option to "Block Account/Contact Matches" checked (this option blocks new Accounts and Contacts from being created if there is a matching Lead). The Salesforce lead conversion code creates the Account FIRST then marks the Lead as converted. DupeBlocker fires as soon as the Account is created, so the "match" is to the Lead that is in the process of being converted.
To confirm this is what is happening (vs. actually matching to another existing Lead), search the error message that is returned for a Lead ID (i.e. do a find for 00Q). Then, compare that ID to the Lead ID that you are attempting to convert. If they are the same that is the issue (only compare the first 15 digits of the ID as the error will have the full 18 digit ID).
There are 3 options for working around the issue.
- Option 1 is the easiest but it will no longer block new Accounts created via any method (not just conversions). A warning will be created instead of a block, so the duplicates will still be detected, and can be converted from the Warnings.
- Options 2&3 require creating custom fields on the Lead and Account tables.
- Option 2 does not require any custom code, but you may miss detecting duplicates to OTHER matching Leads during Lead Conversion.
- Option 3 has no limitations that we have found, but DOES require creating a trigger in your org.
Option 1: Uncheck "Block Account/Contact Matches". Warnings will be created in place of a block when an Account is created that matches an existing Lead. A block will still occur when a duplicate Lead is inserted that matches an existing Account.
Limitation: Will not block, only warn for Account/Contact duplicates to existing Leads.
*****For Options #2 or #3, which will still block duplicate Accounts inserted by other methods besides Lead Conversion, then do the following FIRST:****
- Create two custom checkbox fields (i.e. "From Lead") on the Lead and Account objects, have them visible only to the System Administrator profile and not on any page layout.
- Have the Lead field default to checked and the Account field default to unchecked.
- Go to the Lead field page and set up the Lead field mapping so the lead “From Lead” field is mapped to the Account “From Lead” field. When the conversion happens the inserted Account will have that field checked, but Accounts created via every other method will have that field unchecked.
Option 2: Check "Enable dual filters" on the Scenario and add a Scenario Filter (NOT a target filter as this needs to be a "source" filter so it only applies to the record being inserted) to ONLY trigger if the "From_Lead" field on the Account is false.
Limitation: Will not block or warn if the new Account created from the conversion matches an existing Lead.
Option 3: Create this trigger for Accounts (be sure to update accordingly for whatever the field is actually named). Will cause DupeBlocker to create a warning for VALID duplicate Accounts created during conversion, not block them. In the event the new Account was attempting to match to the "converted" Lead NO WARNING will remain, as DupeBlocker deletes any Warnings for Leads that are converted.
trigger PreventConversionBlocking on Account ( before insert )
if (trigger.new.size() == 1 && trigger.new.From_Lead__c)
Limitation: None, but does require creating a new trigger in the org.