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
sk aleemsk aleem 

how to display 70000 records on visualforce page below scenario.can any slove urgent and reply me

scenario: in an object there are two fields called field1 and field2 and i have 100000 records,out of 70000 record values are equal in field1 and dispaly those 70000 records on visualforce page.
Harpreet On CloudHarpreet On Cloud
You cannot query those 70,000 records directly by giving a where clause like Field1__c = Field2__c. For that you will have to create a Formula field that displays true or false depending on whether Field1__c equals Field2__c.

Once formula field is created, since there is a limit of 50,000 records that can be fetched in 1 context, you will have to fetch records in chunks, preferably, in chunks of 1000 or less, otherwise the page load will have performance problems. So either you can use a pagination or if you want show all data in the same page, you can use "Show more" button.

You can also use for showing records in a tabular layout providing features like filters, search, pagination. It might require some learning but you will have better performance and there is a server side data loading feature too.

OSI technologies
check this post

How to paginate > 10000 records. SOQL OFFSET and StandardSetController too limiting (

If your purpose is to display the records only, then you can set the readOnly='true' in apex:page tag. Using this, the SOQL limit will be relaxed from 50000 to 100000.

Your scenario seems to be an interview question which usually asked.:)

Ravi Dutt SharmaRavi Dutt Sharma
Hey SK Aleem,
Annotate you apex method with @ReadOnly