WHY 'Salesforce Could Not Create This Lead' ?


Have you ever had this error in your organization ? If yes, than you might be already aware of the cause of this error or may be you are still struggling to find out a solution for that.

In this blog we will checkout following things : 

1. What is the cause of this error ?

2. Can we customize it or turn it off ?

3. Do we have any resolution for this ? 


Cause of this error

System Administrator receives an email with the following error message when a customer submits a Lead via Web-to-Lead:

Error: Salesforce could not create this lead because of the reason listed below. For more information about this error or help with Web-to-Case-Lead, please contact Customer Support.

Reason: A country must be specified before specifying a state value for field. OR The alert is sent when a Lead is submitted via Web-to-Lead and one of the field entered is not respecting the Unique value of one of a custom field. In this example, the MyField__c field is affected.

Can we customize it or turn it off

This error could be really annoying as you will get the email alert every time. We can not turn if off as it's a default email that can't be removed. But the idea has been shared with community already, please upvote the idea and maybe we could have it in upcoming releases : 
https://trailblazer.salesforce.com/ideaView?id=08730000000kdQZAAY

Resolution

This error message indicates that 'State and Country as a Picklist' is enabled in your organization.

If the Web-to-Lead form contains standard 'State' and 'Country' fields and the submitter fills the value in 'State' but does not mention the 'Country,' then this error message will be sent to the System Administrator. However, if 'Country' is selected and 'State' is not, then the Lead would be submitted and created successfully.

This error can be avoided by:

Creating custom 'State' and 'Country' fields on Lead and use them on the Web-to-Lead form.
Make the standard 'Country' field is required via HTML Coding (and not Salesforce Validation Rules). Please note that, HTML coding is not supported as part of Salesforce support and should be done by the webmaster or the web developer.


 If you have any question please leave a comment below.

If you would like to add something to this post please leave a comment below.
Share this blog with your friends if you find it helpful somehow !

Thanks
Keep Coding 

Post a Comment

0 Comments