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
ankitha varraankitha varra 

diplaying large set of records in visualforce page

Hai, i have 40000 thousands of records ,those records will be display on the visualforce page, pls do some help
Pankaj_GanwaniPankaj_Ganwani
Hi Ankitha,

Set readonly="true" attribute in <apex:page> tag.
thatheraherethatherahere
Hi Ankitha,

Use List of List in your apex class to hold all the records and added records as 
List< List<sObject> > lstSObjects = new List< List<sObject> >();
Integer i = 0;
List<sObject> lstInnerSobjs = new List<SObject>();
for( List<SObject> sobjs : [ YOUR RECORD QUERY HERE ] ){ // It will return 200 records at a time
     if( i == 5 ){ // List have 1000 records in it(Equal to Max limit to iterate over vf page. )
          lstSObjects.add( lstInnerSobjs ); // Add list to Parent list.
          lstInnerSobjs.clear(); // Clear current records from list.
     }
     lstInnerSobjs.addAll( lstInnerSobjs );
     i++;
}


Now iterate this list of list over Visualforce page with Repeat in side Repeat as:
 
<apex:repeat value="{!lstSObjects}" var="listRecords">
     <apex:repeat value="{!listRecords}" var="sobj">
      Display sobj info there ..... 
     </apex:repeat>
</apex:repeat>

Thanks,
- thatherahere