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
NAGAM VENKATA KRISHNA 8NAGAM VENKATA KRISHNA 8 

I`m new to salesforce and would like to create a vf page which contains html once clicks on submit it will inserted into objects with controller

AnkaiahAnkaiah (Salesforce Developers) 
Hi Venkat,
Can you please provide more information?
on which object you need VF page?

 
NAGAM VENKATA KRISHNA 8NAGAM VENKATA KRISHNA 8
Thank you for replying me Ankaiah, I am trying to insert data in to any custom object.
AnkaiahAnkaiah (Salesforce Developers) 
VF Page:

<apex:page controller="CreateAccountController">
    <apex:form>
        <apex:pageblock>
            <apex:pageblocksection>
                <apex:inputfield value="{!acc.Name}"/>
                <apex:inputfield value="{!acc.Accountnumber}"/>
            </apex:pageblocksection>
            <apex:commandbutton action="{!SaveMethod}" value="Save"/>
        </apex:pageblock>
    </apex:form>
</apex:page>

Apex Controller:

public class CreateAccountController{
     
    //Prpoerties
    public Account acc {get;set;}
     
    //Constructor 
    public CreateAccountController(){        
        //Instances        
        acc = new Account();
    }
     
    //Save Method 
    public PageReference SaveMethod(){
        Insert acc;
        return null;
    }
}
you can replace Account Object with any Custom object.

for more details about VF pages, please go through the trailhead modulehttps://trailhead.salesforce.com/content/learn/modules/visualforce_fundamentals

If this helps, Please mark it as best Answer

Thank you!!
 
NAGAM VENKATA KRISHNA 8NAGAM VENKATA KRISHNA 8
Hi ankaiah my visual force page contains only html I need example apex class and visualforce page to insert data in objects
 
AnkaiahAnkaiah (Salesforce Developers) 
Hi Venkat,

Please refer the below links and try.

https://salesforce.stackexchange.com/questions/100151/how-can-i-receive-data-from-the-formusing-html-css-in-visualforce-page-and-a

https://developer.salesforce.com/forums/?id=906F000000097NJIAY