- Unlike classes and triggers, anonymous blocks execute as the current user and can fail to compile if the script violates the user’s object- and field-level permissions. So, essentially, it is only allows the user to do what they could through the API.
- if you don’t have CRUD for delete on Account, you can’t delete Accounts through anonymous blocks.
- The Author Apex profile perm, only applies to Apex that is stored in the org’s metadata (i.e. normal Apex Classes and Triggers that run in system mode).
- As far as Async Apex (Batch Apex), it doesn’t look like it is possible because @future requires the method be static but anonymous blocks can’t have static methods

Recent Comments