You need to sign in to do that
Don't have an account?
Kiran N
1. Create List of Account and display in the VF Page
I'm new to salesforce. Can someone help me with Creating List of Accounts and display in the VF Page without using SOQL. We need to use an Apex class without SOQL.
May I request you please elaborate the requirement on why you don't want to use the SOQL query for displaying the list of accounts?
Also, I would suggest you please refer to the below link from the forums community with a similar discussion which might help you further.
- https://developer.salesforce.com/forums/?id=9060G000000IBpJQAW
Happy to help further.Thanks,
Nagendra
Yes, you can simply do it using a standard controller. There is no need of displaying list using SOQL in case you are using standard controller in your page.
Standard controller provides direct accessibility to use Standard Objects as well as Custom Objects.
Please try the code below:
<apex:page standardController="Account" recordSetVar="Accounts">
<apex:form>
<apex:pageBlock title="Account List">
<apex:dataList value="{!Accounts}" var="acc">
<apex:outputText value="{!acc.Name}" />
</apex:dataList>
</apex:pageBlock>
</apex:form>
</apex:page>
I hope this code will help you solve your query. Please mark it as best answer if you find it helpful.
Thanks.
Ajay Dubedi