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

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


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




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:pageBlock title="My Content" mode="edit">
<apex:commandButton action="{!save}" value="Save"/>
<apex:pageBlockSection title="My Content Section" columns="2">
<apex:inputField value="{!}"/>
<apex:inputField value="{!account.type}"/>



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..






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

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