+ Start a Discussion


what is @readonly annotation


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.