Search
Twitter
« Logging In Outside of Work | Main | The Correct Values for Salesforce Checkbox Import Field »
Monday
Jul022012

Create a New Record for Object in Visual Force

 Use "Standard Controller"

By using the "SAVE" or "QUICKSAVE" actions, you can create a new record. The following is an example of creating a new contact:

<apex:page standardController="Contact">
<apex:form>
<apex:pageBlock title="My Content" mode="edit">
<apex:pageBlockButtons>
<apex:commandButton action="{!save}" value="Save"/>
</apex:pageBlockButtons>
<apex:pageBlockSection title="Content Section" columns="2">
<apex:inputField value="{!contact.name}"/>
<apex:inputField value="{!contact.type}"/>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>

PrintView Printer Friendly Version

EmailEmail Article to Friend

Reader Comments (1)

good post but please provide full example
April 20, 2015 | Unregistered Commenterp singh

PostPost a New Comment

Enter your information below to add a new comment.

My response is on my own website »
Author Email (optional):
Author URL (optional):
Post:
 
All HTML will be escaped. Hyperlinks will be created for URLs automatically.