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
nagamalli tadikondanagamalli tadikonda 

i want to access 1 million records but soql returns you only 50k records then how do v achieve it without using batch apex?

i want to access 1 million records but soql  returns you only 50k records then how do v achieve it  without  using batch apex?
Best Answer chosen by nagamalli tadikonda
Ajay K DubediAjay K Dubedi
Hi Nagamalli,

You can use @ReadOnly annotation to access 1 million records.The @ReadOnly annotation allows you to perform unrestricted queries against the Force.com database.All other limits still apply.It's important to note that this annotation, while removing the limit of the number of returned rows for a request, blocks you from performing any DML operations within the request.
Normally, queries for a single Visualforce page request may not retrieve more than 50,000 rows.In read-only mode, this limit is relaxed to allow querying up to 1,000,000 rows.

Note : The @ReadOnly annotation is only available for Web services and the Schedulable interface.

Regards,
Ajay