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
Leafen SandyLeafen Sandy 

Insert record from vf page without using any controller

Hi,

Is there any way that I can insert record using a visaulforce page, but not using any controller.

To be even more clear - I have my custum page which looks like the standard record create page (say any object), from here I have to insert new records which should complete the insertion just with the vf page.

Thanks,
Leafen.
Best Answer chosen by Leafen Sandy
Rahul KumarRahul Kumar (Salesforce Developers) 
Hi Leafen Sandy,

VF Page:
<apex:page standardController="Account"> 
 <apex:form> 
 <apex:pageBlock> 
 <apex:pageBlocksection columns="1">
 <apex:inputField value="{!Account.Name}"/>
 <apex:inputField value="{!Account.BillingCity}"/>
 <apex:inputField value="{!Account.BillingState}"/>
 <apex:inputField value="{!Account.BillingCountry}"/>
 <apex:inputField value="{!Account.BillingPostalCode}"/>
 </apex:pageBlocksection>
 
 <apex:pageBlockButtons >
 <apex:commandButton action="{!save}" rendered="{!ISBLANK(Account.Id)}" value="Create"/>
 <apex:commandButton action="{!save}" rendered="{!NOT(ISBLANK(Account.Id))}" value="Update"/>
 <apex:commandButton action="{!delete}" rendered="{!NOT(ISBLANK(Account.Id))}" value="Delete"/>
 </apex:pageBlockButtons> 
 </apex:pageBlock> 
 </apex:form>
</apex:page>



Insert record from Vf Page Please refer the below link for reference. I hope it will be helpful.

Please mark it as best answer if the information is informative.

Best Regards
Rahul Kumar