I get an HTML script error when attempting to convert a Lead via the Salesforce Lead Convert button. How can I get the error to display in a more user friendly manner, i.e. similar to how it displays when a record is blocked or redirected on insert?
This is a known issue with DupeBlocker & Salesforce and occurs when a user attempts to convert a Lead and there is a matching DupeBlocker Account/Contact Scenario set to "Do Not Insert", "Redirect to Existing" or "Do Not Update". The error message is displayed as plain text, rather than displaying it properly as HTML.
There is no fix for this issue at present and Salesforce has indicated that the issue is expected behavior and referenced the following help solution:
Messages Don't Include Hyperlinks or Images when Converting Leads
Knowledge Article Number 000231464
Sometimes, Salesforce administrators set triggers to display messages when you convert leads. Specifically, these triggers call the addError() method with escape=FALSE. In those triggers, administrators can include hyperlinks or images, meant to direct you to helpful content or show you images that give you better context for the message you see.
When those messages appear during lead conversion, Salesforce, however, suppresses any hyperlinks or images, just in case they include any malicious content. Instead, Salesforce displays plain text for those links and images.
Resolution When you see messages that include plain text in place of hyperlinks and images, don't worry. We're just taking precautions against any possibilities of you encountering malicious content while you convert your leads
The complete error message may look similar to this:
1. Change the "Match on Insert/Update Action" to "Report Duplicate" or "Do Nothing".
2. Disable Salesforce blocking for Lead conversions (example below if for Account duplicates, adjust accordingly for Contact duplicates):
Create two custom checkbox fields (i.e. "From Lead") on Lead and Account and 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 conversion happens the inserted Account will have that field checked, but Accounts created via every other method will have that field unchecked.
Then create this trigger for Accounts (be sure to update accordingly for whatever the field is actually named)
Will cause DB to create a warning for duplicate Accounts created during conversion, not block them.
trigger PreventConversionBlocking on Account ( before insert )
if (trigger.new.size() == 1 && trigger.new.From_Lead__c)
Note: We've created an idea on the AppExchange and are hoping Salesforce will implement this (or something similar) which should resolve the issue. To promote better visibility, please vote for the idea: https://success.salesforce.com/ideaView?id=08730000000kzVAAAY