You need to sign in to do that
Don't have an account?
Patricia Lim
VF - <apex:form> not inserting records after hitting save
Hi all. I have a VF page with an <apex:form> component with Account as the standard controller however when I enter details and click save in the preview page or on the community where I placed it as a component, it doesn't add the record to my Salesforce org - what am I missing here?
Thanks
<apex:page standardController="Account"> <h1>Enter Account</h1> <apex:form > <apex:pageBlock title="Edit Account"> <apex:pageBlockSection columns="2"> <apex:inputField value="{! Account.Name}"/> <apex:inputField value="{! Account.Phone}"/> <apex:inputField value="{! Account.Industry}"/> </apex:pageBlockSection> <apex:pageBlockButtons > <apex:commandButton action="{!save}" value="Save"/> </apex:pageBlockButtons> </apex:pageBlock> </apex:form> </apex:page>
Thanks
I have done a quick repro on my dev org with the code provided and could see a new account created in the VF page's preview mode.
To troubleshoot further,check following:
Do you have any pop up blocker enabled because of which you are not getting redirected to newly created account?
Can you enable debug logs in your org and see if there are any error messages?
Thanks
Your final code will be like this
Hope this will help!
Did it resolved your issue?