Things to Remember while working with Future Methods:
- Future annotation must be static methods and can only return a void type.
- The parameter must be primitive data types, arrays of primitive data types, or collections of primitive data types.
- Object can not be passed in the parameters of the method as the state of the object can change at the time of method’s execution. But Ids can be passed.
- You can’t call a future method from a future method. Nor can you invoke a trigger that calls a future method while running a future method.
- It’s not necessary that future methods would execute in the same order they are called for the execution.
- Methods with the future annotation can be neither used in Visualforce controllers in either get or set methods, nor in the constructor.
- Isolating DML operations on different sObject types to prevent the mixed DML error.
- The getContent() and getContentAsPDF() methods can’t be used in methods with the future annotation.
- You’re limited to 50 future calls per Apex invocation, and there’s an additional limit on the number of calls in a 24-hour period.