I get this result:
Salesforce.com Lead Capture Interface
Reason: Your Lead could not be processed. null
Lead Capture Page: Not available.
Record Information:
debug = 1
encoding = UTF-8
last_name = Confetti
oid = <redacted>
retURL = http://www.yahoo.com
status = Open
submit = Submit
If you have any questions, please click on Help & Training
at the top right of any page within salesforce.com
I have no required custom fields or validation rules. Pretty sure the oid is correct (same as the web2lead form generator spat out). I get the same result when I leave out the status field. When I leave off the debug, the page silently redirects to the url passed.
I can manually add a new lead with just the last name of "Confetti".
This was scraped from behind a NAT, but I get the same result when posted from a public IP address - even a Visualpage form in the same salesforce app.
Do they do ip filtering, maybe?
My form (without the status):
<!DOCTYPE html>
<html>
<head>
<title>Test!</title>
<META HTTP-EQUIV="Content-type" CONTENT="text/html; charset=UTF-8">
</head>
<body>
<form action="https://www.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8" method="POST">
<input type=hidden name="oid" value="XXXXXXXXXXXXX">
<input type=hidden name="retURL" value="http://www.yahoo.com">
<input type="hidden" name="debug" value=1>
<label for="last_name">Last Name</label><input id="last_name" maxlength="80" name="last_name" size="20" type="text" /><br>
<input type="submit" name="submit">
</form>
</body>
</html>
Attribution to: JannieT
Possible Suggestion/Solution #1
It looks like by default, the Web2Lead form that's auto-generated by Salesforce is configured to POST to the production endpoint, www.salesforce.com, and will need to be manually changed to test.salesforce.com in order to work for any Sandbox Org.
To do so, locate the following line in the HTML for your web to lead form:
<form action="https://www.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8" method="POST">
and change the 'www' to 'test':
<form action="https://test.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8" method="POST">
See the related posts on Salesforce Community & Developer Boards
Attribution to: Mikey
Possible Suggestion/Solution #2
- Do you have other Web-to-Lead pages that do work?
- Is Web-to-Lead enabled? To verify it is enabled go to
My Name|Setup|App Setup|Customize|Leads|Web-to-Lead
and ensure thatWeb-to-Lead Enabled
is set. - Is the form's action URL correct?
- Do you have the correct org id?
Attribution to: Mike Chale
This content is remixed from stackoverflow or stackexchange. Please visit https://salesforce.stackexchange.com/questions/5132