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
OscarOscar 

anotations

what is @readonly annotation

kevoharakevohara

From the Salesforce docs...

 

@Readonly Annotation

Cory CowgillCory Cowgill

Just to add on to what kevino80's documenation link says.

 

@Readonly annotation will allow you to query unrestricted against Salesforce. This is handy for things like Web Service generated reports and such. You can *currently only executre this in Aysnchronous Apex (Schedulable or Web Service).

 

In Winter 12 they are releasing @ReadOnly annotation so that it can be used in Visualforce Pages also.

 

It will lock any DML Operations which perform updates/deletes/etc, so be careful where you use it.