You need to sign in to do that
Don't have an account?
vijay kumar 300
Standard Controller not fetching the Data
Hi,
I have created a simple visualforce page with a standard controller, but it's not fetching the data from the Account object.please help me.Below is my code snippet.
any help would be appreciated
I have created a simple visualforce page with a standard controller, but it's not fetching the data from the Account object.please help me.Below is my code snippet.
<apex:page standardController="Account" recordSetVar="Account"> <apex:form > <apex:pageBlock title="All Accounts"> <apex:pageBlockTable value="{!Account}" var="a"> <apex:column value="{!a.Name}"/> <apex:column value="{!a.AccountNumber}"/> </apex:pageBlockTable> </apex:pageBlock> </apex:form> </apex:page>
any help would be appreciated
Absolutely there is no issue with the code.Please find the explanation below:
Reason:If you get into the accounts tab and check the view which is selected for accounts,it should be something like
- Recently viewed accounts
- New this week
- New last week
- Platinum and gold SLA customers
When you are loading the visual force page any of the above option should have been selected on the accounts tab,so the reason its not displaying any account records.Solution:Just get into accounts tab and select the view type as
- All Accounts
Now come to the visual force page and refresh the page, the standard controller now will display the list of account object records.I have checked this in my developer org and its working pretty fine.
Kindly mark this as the best solution if it helps you.
Best Regards,
Nagendra.P
All Answers
You are almost there! Just a small change in your code should suffice! Here is the code-
Please upvote and mark this answer as solved, if it helped you.
Cheers!
Ajinkya Deshmukh
I have tried with your code, but i am still facing the same problem.
Thanks,
Vijay.
Absolutely there is no issue with the code.Please find the explanation below:
Reason:If you get into the accounts tab and check the view which is selected for accounts,it should be something like
- Recently viewed accounts
- New this week
- New last week
- Platinum and gold SLA customers
When you are loading the visual force page any of the above option should have been selected on the accounts tab,so the reason its not displaying any account records.Solution:Just get into accounts tab and select the view type as
- All Accounts
Now come to the visual force page and refresh the page, the standard controller now will display the list of account object records.I have checked this in my developer org and its working pretty fine.
Kindly mark this as the best solution if it helps you.
Best Regards,
Nagendra.P
Thank you so much for your help its working fine.
Thank you, the same problem came across and resolved. However, it is showing only limited records, do anyone knows why?