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
AbanteAbante 

Download more than a thousand records in Excel

Hello everyone,

 

 

We've developed a custom button, to download an Excel with records from a custom object. 

 

It works fine and It's really useful, but sometimes there are more than a thousand records... We use a 1.000 records query limit, but It'd be great to download all records.

 

We tried with batch processing but It doesn't work.

 

 

Any idea?

 

Thanks in advance

 

 

SRKSRK

Hmmm it's Possible but if u VF page can hit the view state or a heap size limt error

Eugene PozniakEugene Pozniak

Try to use something like this:

 

<apex:page controller="DownloadExcelController" contentType="application/vnd.ms-excel#ExportResult.xls" showHeader="false" sidebar="false" cache="true" readOnly="true">

. . . 

</apex:page>

 

Set readOnly tag to "true". In read-only mode, a page may not execute any DML operations, but the limit on the number of records retrieved is relaxed from 50,000 to 1 million rows.