You need to sign in to do that
Don't have an account?
Atla Masthanaiah
Insert a record
I have one object like Patient__c. This object contain some fileds.And create one VF tab Patient. Using this object to create a vf page and create some buttons like save and edit nad delete. But I am create a vf page but did not work whith save ,edit,delete buttons how to achive it.
<apex:page standardcontroller="Patient__c" sidebar="false">
<apex:form >
<apex:tabPanel>
<apex:tab label="Patient">
<apex:pageBlock title="patien page">
<apex:pageBlockSection >
<apex:inputField value="{!Patient__c.name}"/>
<apex:inputField value="{!Patient__c.Address__c}"/>
<apex:inputField value="{!Patient__c.Age__c}"/>
<apex:inputField value="{!Patient__c.City__c}"/>
<apex:inputField value="{!Patient__c.DateTime__c}"/>
<apex:inputField value="{!Patient__c.Gmail__c}"/>
<apex:inputField value="{!Patient__c.Phone__c}"/>
<apex:inputField value="{!Patient__c.RegNumber__c}"/>
</apex:pageBlockSection>
</apex:pageBlock>
<apex:commandButton value="save" action="{!save}"/>
<apex:commandButton value="Edit" action="{!Edit}"/>
<apex:commandButton value="Exit" action="{!delete}"/>
</apex:tab>
</apex:tabPanel>
</apex:form>
</apex:page>
Thanks
<apex:page standardcontroller="Patient__c" sidebar="false">
<apex:form >
<apex:tabPanel>
<apex:tab label="Patient">
<apex:pageBlock title="patien page">
<apex:pageBlockSection >
<apex:inputField value="{!Patient__c.name}"/>
<apex:inputField value="{!Patient__c.Address__c}"/>
<apex:inputField value="{!Patient__c.Age__c}"/>
<apex:inputField value="{!Patient__c.City__c}"/>
<apex:inputField value="{!Patient__c.DateTime__c}"/>
<apex:inputField value="{!Patient__c.Gmail__c}"/>
<apex:inputField value="{!Patient__c.Phone__c}"/>
<apex:inputField value="{!Patient__c.RegNumber__c}"/>
</apex:pageBlockSection>
</apex:pageBlock>
<apex:commandButton value="save" action="{!save}"/>
<apex:commandButton value="Edit" action="{!Edit}"/>
<apex:commandButton value="Exit" action="{!delete}"/>
</apex:tab>
</apex:tabPanel>
</apex:form>
</apex:page>
Thanks
This is salesforce Standard functionality which provides some by default actions like save, edit, delete and update.
If you do not want to perform any custom logic and wanted to achieve save, edit and save then you do not not need any controller code. It will work by default.
Thanks,
Amit
The standard controller attribute will tell in which action need to be performed. And those fields will be included that are present in VF page.
Thanks
Anit Singh