The Official Salesforce Blog

The Official Salesforce Blog

Sample Code for a Professional Looking Web-to-Case Form

Jamie Grenney Jul 29, 2005

A web-to-case form can be used to capture cases from your website and route them as fielded information into salesforce.com.

While it’s easy to generate the HTML for a web-case-form from inside salesforce.com, Chris Bonacore a salesforce.com Sales Engineer, has modified the html to pretty it up a bit. It utilizes the salesforce stylesheet for buttons, field labels, etc. It also takes advantage of JavaScript for formatting a phone number field.

To see what it looks like and to demo the functionality, you can Download his Web-to-Case.htm to your desktop. Clicking on that hyperlink will open the file. To download, simply right click on the link and save target as.

Submit_acase2

To make it work for your org specifically, here’s what you’d need to setup.

First change the sample org id to your org id
To find out your Org ID, go to Setup, Administration Setup, Company Profile, Company Information. On the right side you’ll see a field called Salesforce.com Organization ID.

<input type=hidden name="orgid" value="00X300000000ASD">

If you want a confirmation email, please change debug to 1 and your email address.
<input type="hidden" name="debug" value=1>
<input type="hidden" name="debugEmail" value="youremail@acme.com">

If you want to go to another website other than salesforce.com, probably the customer's home page, then set debug to 0 and specify the URL
<input type="hidden" name="debug" value=0>
<input type=hidden name="retURL" value="http://www.acme.com">

When it’s set up, Web-to-Case will try to match the Case to Contact via the Email address on the form. Give it a try and see if Web-to-Case can help streamline your workflow.

 

3 Comments

Jason

Dorothy Mantooth is a saint!

Thomas

Can I add a field for file attachments in the form, so that the attachments can be added for the new case?

Kingsley

Thomas, not as far I know. If you have server side programming skills, you could upload the file to your server and reference the URL as a field in the case.

Post a comment