The @future
annotation (pronounced as at future) is, perhaps, the simplest method of asynchronous code execution on the Salesforce1 platform. The @future
, is a method annotation that makes the method run asynchronously at some point in the near future. Generally, this happens quite quickly, but no time guarantees are established annotation methods as @future
is fantastically useful, but has a number of caveats and limitations that developers must remain mindful of:
Most importantly, methods annotated with
@future
can only accept primitive parameter types. String, Integer, and so on, are your only options.You cannot chain methods annotated with
@future
. In other words, an@future
annotated method cannot be called from another@future
annotated method. This is especially crucial to remember when your@future
method may result in a trigger firing. If an@future
method fires a trigger, that trigger cannot in turn call other@future
annotated methods.Methods...