@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.

Only WebService, RemoteAction, or Schedulable.execute() methods can be marked read-only.

For more information, check the below link

https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_classes_annotation_ReadOnly.htm

Cheers!!!

No comments:

Post a Comment