To define a future method, simply annotate it with the future
annotation.
global class FutureClass
{
@future
public static void myFutureMethod()
{
// Perform some operations
}
}
Methods with the future
annotation must be static methods, and can only return a void type. The specified parameters must be primitive data types, arrays of primitive data types, or collections of primitive data types. Methods with the future
annotation cannot take sObjects or objects as arguments.
Methods with the future annotation have the following limits:
- No more than 10 method calls per Apex invocationNote
- The maximum number of future method invocations per a 24-hour period is 250,000 or the number of user licenses in your organization multiplied by 200, whichever is greater. This is an organization-wide limit and is shared with all other asynchronous Apex: batch Apex and scheduled Apex.
Useful Documentation
Attribution to: Alex Tennant
This content is remixed from stackoverflow or stackexchange. Please visit https://salesforce.stackexchange.com/questions/32031