QUESTION:
I get a HTML script error when creating a duplicate Contact/Account from the "Log a Case/Create Case" or any "Quick Create" screen. How can I get the error to display in a more user friendly manner, for example, similar to how it displays when a record is blocked or redirected on insert?
ANSWER:
This is a known issue with DupeBlocker & Salesforce and occurs when a user creates an Account or Contact from the Log a Case/Create Case/Quick Create screen and there is a matching DupeBlocker Account/Contact Scenario set to "Do Not Insert" or Redirect to Existing". The error message is displayed as plain text, rather than displaying it properly as HTML.
There is no fix for this issue at present as Salesforce does not consider this a bug in their code. The only workaround is to change the "Match on Insert Action" to "Report Duplicate" or "Do Nothing".
The complete error message may look similar to this:
Error: Invalid Data.
Review all error messages below to correct your data.
<!-- DupeBlocker blocked this action - duplicates found. --> <div style="padding:0.7em;font-size:11px;width:40em;margin:0 auto;background-color:#FBF9EE;border-color:#FCEFA1;border-width:1px;border-style:solid;border-radius:4px;">< P align="center"><font color="black"><strong>DupeBlocker Duplicate Prevention</strong></font></P>< P align="left"><font color="red">Duplicate found based on Account Name and Phone</font><font color="black"><ul>< li align="left"><a name="db_BlockLink" href="/001C000001TWuleIAD">XYZ Inc.</a></li>< /ul></font></P></div><BR/>< script type="text/javascript">< /script><script src="/soap/ajax/31.0/connection.js" type="text/javascript"></script><script src="/soap/ajax/31.0/apex.js" type="text/javascript"></script><script type="text/javascript"> sforce.connection.sessionId = "00D80000000LHvC!AR8AQDvixe8ZZWU8GBQL_8qZ7daFnhoLTGj4DyKI_YnnoSLptgMxYBm1LC4YL0Az1d2Ya5ttNw94TgZ6udKXekBHX.XjCtNW"; sforce.apex.execute("CRMfusionDBR101/DB_WebServices","IncrementScenarioBlockCount",{scenarioId:"a2zC0000000MswbIAC", blockCount:1}, {onSuccess: doNothing, onFailure: onError} ); function doNothing(){} function onError(error){if(error.faultcode.toLowerCase()=="sf:insufficient_access"){alert("You do not have access to the DupeBlocker web services. Please contact your Salesforce administrator.\nThe configuration instructions are in the DupeBlocker install guide."); } else{alert(error.toString());} } var blockLinks = document.getElementsByName("db_BlockLink"); if ( ( location.href.toLowerCase().indexOf( "?isdtp=" ) >= 0 || location.href.toLowerCase().indexOf( "&isdtp=" ) >= 0 ) && blockLinks != null && blockLinks.length > 0 ) { for ( var linkLoop = 0; linkLoop < blockLinks.length; linkLoop ++ ) blockLinks[linkLoop].href += "?isdtp=vw"; }< /script>
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