Tips for testing web-to-lead on SalesForce sandbox server
The SalesForce Web-to-Lead URL is well known to be: https://www.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8
If you have access to a Sandbox server to do your development, you may want to test Web-to-Lead against it. You first should go into the setup area to find your OID (Organization ID) which will differ from your production OID. Find this from SalesForce's top "Setup" link. Then drill down into the left navigation menu:
App Setup / Customize / Leads / Web-to-Lead
Make sure the checkbox for Web-to-Lead Enabled is checked. Then click the "Create Web-to-Lead Form" button. On the next page, keep all selected fields as defaults and click the "Generate" button. Look in the generated HTML output for your unique OID which is given in the first hidden form field. You should see lines of code like this:
<!-- NOTE: Please add the following <META> element to your page <HEAD>. -->
<!-- If necessary, please modify the charset parameter to specify the -->
<!-- character set of your HTML page. -->
<!-- ---------------------------------------------------------------------- -->
<META HTTP-EQUIV="Content-type" CONTENT="text/html; charset=UTF-8">
<!-- ---------------------------------------------------------------------- -->
<!-- NOTE: Please add the following <FORM> element to your page. -->
<!-- ---------------------------------------------------------------------- -->
<form action="https://www.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8" method="POST">
<input type=hidden name="oid" value="youroidhere">
Remember, you are developing for tests against the Sandbox server, so you will need to modify the Form action to match the URL of your Sandbox homepage. Look at your Sandbox url and replace "www" with the proper subdomain, such as "cs2" in this example.
Example Sandbox homepage: https://cs2.salesforce.com/home/home.jsp
New Web-to-Lead Form action: https://cs2.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8


There are no comments for this entry.
[Add Comment]