Find your content:

Search form

You are here

What is the best way to debug a post to the WebToLead servelet?

 
Share

I have a VisualPage form that posts to

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

After the post my browser correctly gets redirected to the post value specified in retURL, but the lead is not added to the database.

What is the best way to debug this problem?

Also, if someone has a list of the required post fields that the servlet expects as mandatory. Are the key names case sensitive?

Thanks!


Attribution to: JannieT

Possible Suggestion/Solution #1

I'm not sure if the key names are case-sensitive (I expect they are), but the identifiers for custom fields change from org to org. If you have Lead.My_field__c in a sandbox, it will have a different id in production. The only fields that are mandatory are:

  1. Lead.LastName
  2. Lead.Status (update: this may be set automatically by SF)
  3. Any custom field you mark as required in the definition
  4. An HTML hidden input for oid, which is your org's id

In addition, there are form fields you can add that put your form into debug mode. The following was taken from UI's Web2Lead generation tool:

<!--  ----------------------------------------------------------------------  -->
<!--  NOTE: These fields are optional debugging elements. Please uncomment    -->
<!--  these lines if you wish to test in debug mode.                          -->
<!--  <input type="hidden" name="debug" value=1>                              -->
<!--  <input type="hidden" name="debugEmail"                                  -->
<!--  value="myemail@mydomain.com">                                           -->
<!--  ----------------------------------------------------------------------  -->

Enabling debug mode will do the following:

  1. Not submit the Lead to your org
  2. Display all form elements in your browser

In my experience, however, we receive an email whenever Salesforce cannot generate the Lead from the form's data. If you do not receive these emails you might be sending the form to the wrong org or have something mis-configured.


Attribution to: Mike Chale
This content is remixed from stackoverflow or stackexchange. Please visit https://salesforce.stackexchange.com/questions/5089

My Block Status

My Block Content