function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Raj R.Raj R. 

How would I create a visualforce page that is a form that save form fields into a custom object?

Hi,

I have a custom object called customObj__c. I need to create a visualforce page that looks like this:

First Name : <textbox input>
Last Name : <textbox input>
Email: <textbox input>
<submitButton Here>

When the Submit button is pressed, i need to simply create a new customObj__c record using the values entered in the form (first name, last name, email). How to do I accomplish this? I am confused as to how I can use a class to save the new record on Submit button click.
Best Answer chosen by Raj R.
William LópezWilliam López
Hello rRup,

Here is a good example of a VF page and a controller:

http://www.salesforce.com/docs/developer/pages/Content/pages_controller_custom.htm

But if you have a custom object with some fields, you can use the starndard page layout and the starndard edit page to save this information, there is not need to add custom code if you just want to save some basic data, usually a visual force page + controller its when you have a custom page with some expecial requeriments. 

Here is a video (kind of old but its shows the basic) about how to create a custom object and use the pagelayout to insert data:

https://www.youtube.com/watch?v=uD5t8rCvqlE

I hope this helps.