๐ฌ In plain words: Navigating asynchronous Apex is all about knowing who is allowed to call whom. A Queueable can chain itself, and a Batch can start a Queueable . However, a @future method is a dead end—it cannot call another @future , and a Batch cannot call a @future . Memorizing this simple matrix eliminates an entire category of runtime crashes. Key Points at a Glance The Future is a Dead End: You cannot call a @future method from any other async context (Batch, Queueable, or another Future). Queueable is the Swiss Army Knife: You can enqueue a Queueable from a Trigger, a Batch execute() or finish() , and even chain it to another Queueable. Batch Chaining: You can legally chain a new Batch job, but only from the finish() method of the current Batch. Callout Rule: Callouts require the correct marker ( callout=true or Database.AllowsCallouts ) and can never occur after a DML operation in the same transaction. ๐ Real...
Search This Blog
Search vtfriday
Find practical Salesforce, AI, Agentforce, Apex, LWC, Data 360, Life Sciences and Manufacturing Execution System (MES) guides.