You need to sign in to do that
Don't have an account?
Jagadish Lutimath
how to invoke one class future method in another apex class?
Hi Everyone,
I have written an apex class which has a future method. As of now, I am invoking that class method through triggers and it is working as expected. Here my requirement is, we have a helper class and I need to invoke the future method through the helper class. Can anyone let me know how to invoke the future method from helper class?
Appreciate any help.
I have written an apex class which has a future method. As of now, I am invoking that class method through triggers and it is working as expected. Here my requirement is, we have a helper class and I need to invoke the future method through the helper class. Can anyone let me know how to invoke the future method from helper class?
Appreciate any help.
We can directly call future method using its class name.future method name.
please find example.
Please let me know, if it helps you.
Best Regards,
Dayakar.D
01 public with sharing class WarehouseCalloutService {
02 @future()
03 public static void runWarehouseEquipmentSync(Set<id> OppIds){
04 //Some code here.....
05 }
06 }
07
08 another apex class
09 *****************************
10 public class Maintenance{
11 public static void callingFuture()
12 {
13 WarehouseCalloutService.runWarehouseEquipmentSync();
14 }
15
16}