Development questions

When should you use Queueable Apex instead of @future methods inside a trigger handler?

DevelopmentMediumAccenturePwCPersistent

Prefer Queueable over @future in almost all cases:

  • Accepts SObjects and complex types (future allows only primitives)
  • Returns a job Id for monitoring
  • Supports chaining jobs
  • Can be called from other async contexts (limited chaining), whereas future cannot be called from future/batch
  • Easier to test and to add Finalizers

Use @future only for very simple fire-and-forget logic or legacy code, and for Mixed DML separation when simplicity matters. Watch the limit of 50 jobs enqueued per transaction (1 from async).

apex-triggertriggerasyncqueueable