.ultrageek. Computers, Music, and Thoughts


Silly Dev Trick: Apex Flex Queue with Web Callouts

More of a watch out for this but when using Apex Flex Queue with classes that do web callouts you have to add 'Database.AllowsCallouts' to your queueable class like so:

public class ExampleQueueableClass implements Queueable, Database.AllowsCallouts{

This got me but after the usual hunt and peck the googles answered the call: https://salesforce.stackexchange.com/a/216346/17245

This is the error the console throws that is confusing:

Callout not allowed from this future method. Please enable callout by annotating the future method. eg: @Future(callout=true)