function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
renaiah anamalla 6renaiah anamalla 6 

what is the @future annotation? what is the use of @future annotation explain briefly

what is the @future annotation? what is the use of @future annotation explain briefly
AshlekhAshlekh
Hi,

@Future annotation tell a methods that it is a future method and run asynchronously in background.

Here is documentation 
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_invoking_future_methods.htm
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_classes_annotation_future.htm
http://blog.jeffdouglas.com/2013/04/04/why-the-force-com-future-annotation-should-die/

-Thanks
Ashlekh Gera

 
nagachandra knnagachandra kn
1. Future method executes in a seperate thread.
2. It has higher governor limits.
3. whenever you call a future method salesforce pushes the job to a queue and when system resources are available it executes the methods.
4. only primitive values can be passed to future method.
5. you can future annotation inside a trigger to make a callout.
6. future methods should be static.

https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_classes_annotation_future.htm

Thanks
-Nag