Yes, you are correct since Future methods can be accessed from any class and not depend on any class instance it is declared as Static, also Static keyword make it as utility method rather than normal class method.
why Void? Future method runs on it own thread, so it cannot return any values to previous instance.
Thanks for your quick response. "Future method by definition is static so that variables with this method is associated to the class and not the instance and you can access them without instantiating the class."
Is this the only reason to declare future method as static?
Yes, you are correct since Future methods can be accessed from any class and not depend on any class instance it is declared as Static, also Static keyword make it as utility method rather than normal class method.
why Void? Future method runs on it own thread, so it cannot return any values to previous instance.
Nitish,
Yes, you are correct since Future methods can be accessed from any class and not depend on any class instance it is declared as Static, also Static keyword make it as utility method rather than normal class method.
why Void?
Future method runs on it own thread, so it cannot return any values to previous instance.
Hope this make sense.
Thanks,
Gaurav
All Answers
You may find this reference useful.
https://www.forcetalks.com/salesforce-topic/why-future-method-is-void-and-static-in-salesforce/
hope this helps.
Regards,
Thanks for your quick response.
"Future method by definition is static so that variables with this method is associated to the class and not the instance and you can access them without instantiating the class."
Is this the only reason to declare future method as static?
Regards,
Nitish,
Yes, you are correct since Future methods can be accessed from any class and not depend on any class instance it is declared as Static, also Static keyword make it as utility method rather than normal class method.
why Void?
Future method runs on it own thread, so it cannot return any values to previous instance.
Hope this make sense.
Thanks,
Gaurav
Regards