I would like to post an HTML form, hosted outside of Salesforce, to a custom object.

I figure it would be similar to a Web to Case, where you post to a certain URL with some specific hidden fields, such as 'orgid'.

So far I have only found Web To Custom Object scenarios, where Salesforce pages are used. Could someone post me in the right direction? Preferably an example of a what the HTML form and Controller class would look like?

2 Answers 2


I'm not sure what you are trying for is possible without a site and a page. I just looked at the requests from the standard page and it contains a confirmation token.

standardnform variables

Create a new site and edit the public access to a enable a new visualforce page with standard controller.

Open your browser with fiddler HTTP debugging enabled and submit the form with your browser. This will show you the HTTP requests required to emulate using HTTP Post form if possible...otherwise I would recommend using JavaScript or some server side language to make the HTTP requests.

Fiddler is an excellent tool for this development.

  • Should have thought of that. Excellent suggestion. Thanks! Salesforce might not allow posts with a different referrer, but I will give it a try.
    – Oxidator
    Commented Mar 24, 2015 at 1:53
  • You need to make your site public in order to do this, just a security reminder. You can only entitle write to that one object though...
    – Berkshire
    Commented Mar 24, 2015 at 2:00
  • I have successfully created a webpage, hosted it locally, and created new objects in the test environment by posting to it. In order to this I had to created an apex page first and grab all the hidden fields. Note that these fields will change every time you change the page or the controller class. Another thing to note is that if you get an error of some kind, by default you are returned to the apex page. I handle this in the controller by returning to the webpage with an additional variable in the URL.
    – Oxidator
    Commented Apr 10, 2015 at 5:02

I feel that the easiest way will be to post the form as email to an inbound email handler service in apex. Please try below steps,

1) Create an inbound email service in salesforce. It will give you an email address. 2) Create a form with post action as email

<form action="MAILTO:[email protected]" method="post">
    your form input tags goes here

3) Update your inbound email handler class to parse the data that is coming as email and insert record in your custom object.

Details regarding inbound email service can be found in below link,


You must log in to answer this question.

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