You need to sign in to do that
Don't have an account?
Anuj Thakur 4
Account is not created using VF page
Hi
I have created a VF page. I am trying to create a new Account with the help of my VF page. its running successfully but not saving the data i salesforce.
after entering the values in input text box and saving, I checked but account is not created.
caould someone help meon this. why Account is not created.
This is my VF page:
<apex:page standardController="Account">
<apex:form >
Name: <apex:inputText value="{!account.Name}"/><br/>
Phone:<apex:inputText value="{!account.Phone}"/><br/>
<apex:commandButton value="Create New account" action="{!Save}"/>
</apex:form>
</apex:page>
Thanks,
Anuj
I have created a VF page. I am trying to create a new Account with the help of my VF page. its running successfully but not saving the data i salesforce.
after entering the values in input text box and saving, I checked but account is not created.
caould someone help meon this. why Account is not created.
This is my VF page:
<apex:page standardController="Account">
<apex:form >
Name: <apex:inputText value="{!account.Name}"/><br/>
Phone:<apex:inputText value="{!account.Phone}"/><br/>
<apex:commandButton value="Create New account" action="{!Save}"/>
</apex:form>
</apex:page>
Thanks,
Anuj
1)Try adding the apex:pagemessages , to find if there is any error.
2) Run developer console and check the count of records of account before and after clicking the save button if there is increase in number , then your account has been created. If not , then need to check the debug logs as mentioned by above
Hope this helps.
All Answers
please mark the question as solved If this helps you good luck
There is only one required field that is Name. I am using standard controller Account. I have checked the link you have provided, in that they have used <apex:inputField> buut I am using <apex:inputText> but I think this should not be the issue. i am not getting any error also so cant track.
1)Try adding the apex:pagemessages , to find if there is any error.
2) Run developer console and check the count of records of account before and after clicking the save button if there is increase in number , then your account has been created. If not , then need to check the debug logs as mentioned by above
Hope this helps.
I have tested your code that's was perfect, Please use: Kindly mark my solution as the best answer if it helps you.
Thanks
Mukesh
Thanks for your help!!
I added <apex:pagemessages/> in page. and got the validation error on page.
It is runnnig successfully now.
Thanks Dushyant :)
Regards,
Anuj