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
Rahul Gupta 194Rahul Gupta 194 

Collection Error in VF page

I have a list that has 14k records that i am able to display in table through pagination. Now i want to Downlaod the records in Excel on click of button So  i am using Another page by page reference with same controller and passing the list in apex repeat .
But it is showing  error:
Collection size 14,371 exceeds maximum size of 10,000
Any way how can I get this problem Resolved .
 
NagendraNagendra (Salesforce Developers) 
Hi Rahul,

Visualforce is not designed to display more than 1000 records on the same page. Generally speaking, if your SOQL's are returning more than 1000 records and you attempt to display these records on a VF page, you will receive this error.

To resolve this you can use Bootstrap Data table to display the data. Bootstrap data table can handle 5000+ records and works Fine.

Pass the data using JSON format to data tables and generate the DataTable in javaScript.

Refer the following link: Hope this helps.

Mark this as solved if it's resolved.

Thanks,
Nagendra
Rahul Gupta 194Rahul Gupta 194
Thanks Nagendra ..  But I would need code snippet if you can help .