@ReadOnly annotation in Salesforce

@ReadOnly annotation in Salesforce

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 the following operations within the request: DML operations, calls to System.schedule, calls to methods annotated with @future, and sending emails.
 
A Visualforce page cannot hold more than 1000 records. But, @readOnly annotation increases this limit to 10,000. 
Only WebService, RemoteAction, or Schedulable.execute() methods can be marked read-only.
 
Using Apex, the Total number of records that can be retrieved by SOQL queries is 50,000. It is used to increase the SOQL limit from 50k to million.
 

Leave a Reply