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
veeru417veeru417 

Is it possible to creat e a new record for an object through VF page using std contrlr

Hi,

Is it possible to creat e a new record for an object through visualforce page using standard contoller.

 

 

AditiSFDCAditiSFDC

Yes it is possible.

If you want create new record, simply use the "SAVE" or "QUICkSAVE" action of Standard Controller.

 

Quoting a simple example to create a new Account :

 

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

veeru417veeru417

hi,

i have created similar code it is not  working in my  dev edition and works perfectly in another development edition .what is problem.i tried it for custom objects also but standard the standard actions are not working..

 

 

Thanks,

veer

AditiSFDCAditiSFDC

Can you post the piece of code which is not working in your development org ?

jha.pk5@cloud.comjha.pk5@cloud.com

No this code is working properly. i had check in my personal account