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
VSK98VSK98 

I have used the Recordsetvar example, but records not displaying

Hi All,

I have tried to use Recordsetvar attribute in page component for displaying the records with sample code, but records not displaying
here is my code
<apex:page standardController="Account" recordSetVar="accounts" tabstyle="account"
sidebar="false">
<apex:pageBlock >
<apex:pageBlockTable value="{!accounts}" var="a">
<apex:column value="{!a.name}"/>
</apex:pageBlockTable>
</apex:pageBlock>
</apex:page>

Adv Thnx
Siv
venkat-Dvenkat-D
WHat is the error or page thats displayed. Also did you check if there are any records?
Richard Jimenez 9Richard Jimenez 9
Hi Siv,

I have copied the code into a dev org and it works as expected. Who are you viewing the page as? check account data visibiltit / check you can see accounts on the standard account tab/page.

Thanks,
Richard.
Amit Chaudhary 8Amit Chaudhary 8
YOur code look good to me even i tested below code in my org working fine.
<apex:page standardController="Account" recordSetVar="accounts" tabstyle="account" sidebar="false">
    <apex:pageBlock >
          <apex:repeat value="{!accounts}" var="a">
<apex:pageBlockSection title="{!a.name}"></apex:pageBlockSection>
  <apex:relatedList list="Contacts" subject="{!a.Id}"/>
<apex:relatedList list="Opportunities" subject="{!a.Id}" />
</apex:repeat>      
     </apex:pageBlock>
</apex:page>

PLease check data in your org and Check record in Account TAB
 
VSK98VSK98
Yeah ........Records are having in my object............But Still nt showing in vf page
Virath C. LiyanageVirath C. Liyanage
You need to append query string: id along with the url of the visualforce page to instatiate the recordSetVar, otherwise it will return empty.
Ganesh GunagiGanesh Gunagi
Go to Accounts Tab 
Check the filter, change it to 'All Accounts' view then you may find the records.