Choosing Between @future and Queueable Apex for Asynchronous Work
Decide when to use Salesforce @future methods versus Queueable Apex based on parameter types, job chaining, and monitoring needs.
ReadMeFeed / Community knowledge
Real questions. Useful conversations. Find the people who know your stack.
Decide when to use Salesforce @future methods versus Queueable Apex based on parameter types, job chaining, and monitoring needs.
When off‑loading logic in Salesforce, decide between @future and Queueable Apex. This guide outlines constraints, compares features in a table, explains trade‑offs, and shows concrete code examples with validation steps.
Move trigger logic into a handler class to stop recursion, enable isolated unit tests, and keep bulk processing safe. This guide shows a minimal dispatcher, a recursion‑guard using a Set<Id>, and a worked Account example you can run in a scratch org.
Learn how Apex’s Database.Stateful lets batch jobs remember data between executions, the memory trade‑offs, and a step‑by‑step example that keeps a running total across 200,000+ records.
Learn how to remove hardcoded values from Apex by implementing Custom Metadata Types, reducing deployment risks and allowing admins to manage environment settings.
Enqueue asynchronous Apex jobs that accept sObjects and chain follow-up work, then monitor results in AsyncApexJob.
Learn how to publish a Platform Event from an Order insert and build an idempotent subscriber that keeps integration logic separate from core Salesforce transactions.
Learn how Database.Stateful preserves instance variables across Batch Apex chunks, with a worked counting example and heap limits to watch.
When you need to move millions of old Account records out of the active database, Batch Apex lets you break the work into chunks, stay under governor limits, and keep the org responsive. Learn how to write, run, and monitor a batch that archives inactive accounts in Salesforce.