Showing posts with label Future Methods. Show all posts
Showing posts with label Future Methods. Show all posts

Tuesday, 15 April 2014

Future Methods Limitations

Hi

Below are the list of the limitations for future annotation.

  • 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.

  • Remember that any method using the future annotation requires special consideration because the method does not necessarily execute in the same order it is called.

  • Methods with the future annotation cannot be used in Visualforce controllers in either getMethodName or setMethodName methods, nor in the constructor.
 
  • You cannot call a method annotated with future from a method that also has the future annotation. Nor can you call a trigger from an annotated method that calls another annotated method.

  • The getContent and getContentAsPDFPageReference methods cannot be used in methods with the future annotation. 

For more information please refer the below link.

https://www.salesforce.com/us/developer/docs/apexcode/Content/apex_classes_annotation_future.htm