What is Future Methods –
A future method runs asynchronously in background. You can use future method if you have long-running operations(callouts to external Web services or any operation that runs in its own thread and time. Also you can used for isolated DML operations. Each future method is queued and executes when system resources become available. Your program doesn’t have to wait for the completion of a future methods call.
Methods with the future annotation must be static methods
Only return a void type
Cannot take sObjects or objects as arguments
If you want to pass sObjects that already exist in the database, pass the sObject ID or IDs and use the ID to perform a query in DB inside the future methods.
global class FutureExample
public static void futureMethodExample()
// some operations
Latest posts by Gopal Das (see all)
- Salesforce Certified Platform Developer I – Winter ’18 Release Exam - November 23, 2017
- Salesforce Certified Platform App Builder – Winter ’18 Release Exam - November 22, 2017
- Salesforce Certified Administrator – Winter’ 18 Release Exam - November 21, 2017