• confused
  • NEWBIE
  • 0 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 2
    Replies

I have created a new custom object as "Automobile__c"

 

for the same object i have created a page and a controller to insert new record in to the same.

 

Visualforce Page:

 

<apex:page Controller="VolunteerRegisterContr" > <apex:sectionHeader title="Customer Opportunity" subtitle="Step 1"/> <apex:form > <apex:pageBlock title="Customer Information" mode="edit"> <apex:pageBlockButtons > <apex:commandButton action="{!Save}" value="Save" immediate="true"/> </apex:pageBlockButtons> <apex:pageBlockSection title="Registration"/> <table> <tr><td> <apex:outputLabel >Name</apex:outputLabel></td><td> <apex:inputField id="accountName" value="{!auto.Last_Name__c}" required="false" /></td></tr> <tr><td><apex:outputLabel >Street</apex:outputLabel> </td><td> <apex:inputField id="accountSite" value="{!auto.Street__c}"/></td></tr> <tr><td> <apex:outputLabel >Organization Name</apex:outputLabel> </td><td><apex:inputField id="contactFirstName" value="{!auto.Organization__c}"/></td> </tr><tr><td> <apex:outputLabel >Education</apex:outputLabel> </td> <td> <apex:inputField id="contactLastName" value="{!auto.Education__c}"/></td></tr></table> </apex:pageBlock> </apex:form> </apex:page>

 

 

 

Class

 

Public class VolunteerRegisterContr{ public ApexPages.StandardController controller; //Public Account acc{get; set;} Public Automobile__c auto{get; set;} Public String aName {get; set;} Public String aManufactureNamec {get; set;} Public String aLName {get; set;} Public String aStreet {get; set;} Public String aEdu {get; set;} public VolunteerRegisterContr(ApexPages.StandardController Controller) { auto=(Automobile__c)Controller.getRecord(); this.controller=Controller; } public VolunteerRegisterContr(){} public PageReference Save() { insert auto; return null; } }