1

We work with a lead partner who posts leads to our SF org. They receive the following error when creating a test lead:

Gateway: https://www.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8

Fields to send: FirstName=Bob&LastName=Flynn&Company=PMG&Phone=5615889339&email=no%40mail.com&Street=1234+Main+St&City=Delray&State=FL&Zip=33446&time_in_business__c=5&desired_loan_amount__c=10000&AnnualRevenue=100000&Lead_Type__c=Picklistphone&Monthly_Revenue__c=61-90&debug=1&LeadSource=Powers-LiveTransfer

Response:

Salesforce.com Lead Capture Interface Reason: We could not create this lead. Lead Capture Page: Not available.
 Record Information: AnnualRevenue = 100000 
City = Delray 
Company = PMG 
FirstName = Bob 
LastName = Flynn 
LeadSource = Powers-LiveTransfer
 Lead_Type__c = Phone 
Monthly_Revenue__c = 61-90 
Phone = 5615889339 
State = FL 
Street = 1234 Main St 
Zip = 33446 
debug = 1 
desired_loan_amount__c = 10000
 Email  = no@mail.com
 encoding = UTF-8 
time_in_business__c = 5 
If you have any questions, please click on Help & Training at the top right of any page within salesforce.com

I also had them try swapping the field ids (e.g. CF00NA000000A9K40 ) rather than API name for custom fields, but no luck. I was able to create this lead with these values using dataLoader so there shouldn't be any issue with validation rules. All the data types of the fields match the input type. AND I checked that the default lead creator has the default record type assigned that I'm expecting. This is meant to post to production, not the sandbox.

The only other thing I can think of us is needing to encode the email so @ doesn't appear as %40?

Any thoughts?

Thank you!

  • 1
    I don't think you need to encode the email! Have you checked the salesforce orgId on the HTML form? – abhi Nov 18 '15 at 15:10
  • According to our partner, we are not using an HTML webform (news to me!) but are sending data via the URL? Does that mean the orgID needs to be passed in the URL like any other field value? Does method=post also need to be included in the URL? – Ian Nov 18 '15 at 16:25
  • Apparently we are not posting via Web2Lead but rather a direct data post? Anyone have experience with this method? We've tried swapping encoding=UTF-8 with Method=post as well as passing in our org id. – Ian Nov 18 '15 at 20:46
  • We have an HTML form and there is a hidden field <oid> on that form. This contains the ORG ID for the salesforce org. We are doing the submit using POST. I see that you're doing this using a GET. – abhi Nov 18 '15 at 21:05
  • Ah, that's probably the problem, we want to be using a POST rather than GET. How would I construct a POST? – Ian Nov 18 '15 at 21:54
2

I tried the same thing in my sandbox. It works if I add the orgid to the query string. &oid=<your company org id> is what you need to add.

Before trying this in my org, I had to remove all the custom fields you had in your query string.

https://cs24.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8&first_name=Bob&last_name=Flynn&company=PMG&phone=5615889339&email=no%40mail.com&street=1234+Main+St&city=Delray&state=FL&Zip=33446&annualrevenue=100000&debug=1&oid=<CompanyOrgId>&online=true

I also had to change the case on some of the fields. Please notice the updated URL.

  • Using your answer as a starting point, I found the real error was trying to use the API names of the fields. What ended up working was to generated a web-to-lead form, then pull the field id's from that html form. So rather than FirstName, it was first_name. Also I used the field IDs for custom fields. – Ian Dec 1 '15 at 20:08
  • Did you have to add the company org id to the call? – abhi Dec 1 '15 at 20:26
  • Yep, I forgot; that was part of the solution as well. (Although using the API names ensured it failed even after adding in the orgID :) ) – Ian Dec 1 '15 at 21:40
0

I have also run into this error, however the reason for my org throwing the error was much more simplistic. If you attempt to create a lead that is similar to another record in this org, it will throw an error. Because of the standard duplicate rules on leads.

Normally, this error relates to the Salesforce's Standard Duplicate rule. If you have this rule enabled, it'll be showing an alert every time you are trying to create a duplicate record.

https://help.formassembly.com/help/salesforce-error-use-one-of-these-records

Standard Lead Duplicate Rule The standard lead duplicate rule defines what happens when a user views a lead with duplicates or starts to create a record that duplicates a lead. If your org was created in Summer ’17 or later, this duplicate rule includes a cross-object matching rule: It matches leads that duplicate other leads and contacts that duplicate leads. If your org was created before Summer ’17, you can get the same functionality by activating a new duplicate rule available in Setup. Otherwise, your default rule matches only leads that duplicate other leads.

https://help.salesforce.com/articleView?id=duplicate_rules_standard_rules.htm&type=5

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.