3

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>
4
  • Can you post any of your form's HTML?
    – Mike Chale
    Commented Dec 6, 2012 at 15:57
  • @Mike, added the HTML as requested - straight from the salesforce web2lead generator.
    – JannieT
    Commented Dec 6, 2012 at 17:55
  • 2
    Is that OrgId a Production/Dev Org or a Sandbox Org? If it's a Sandbox you may want to try POST-ing to test.salesforce.com. Just a thought.
    – Mikey
    Commented Dec 6, 2012 at 18:51
  • @Mikey, thanks! That was it. Can you please add your comment as an answer so that I can accept it.
    – JannieT
    Commented Dec 7, 2012 at 5:22

2 Answers 2

8

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

1
  • 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 that Web-to-Lead Enabled is set.
  • Is the form's action URL correct?
  • Do you have the correct org id?
2
  • Thanks for the pointers, Mike, but nothing to work on: 1. I don't have any WebToLead pages that work in the sandbox. 2. Web-to-Lead is definitely enabled. 3. I've posted the HTML which shows the form action and it looks correct 4. org id was pasted from the generator. When I do a {!$Organization.Id} it has the same id with a MAG postfix
    – JannieT
    Commented Dec 6, 2012 at 18:22
  • 1
    I think Mikey nailed it in his comment on your question; sandboxes POST to a different URL.
    – Mike Chale
    Commented Dec 6, 2012 at 19:09

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .