You need to sign in to do that
Don't have an account?
Ajay Xiao
Future methods and interfaces
Hi all,
I created an interface, in which the classes that implement this interface has future methods for calling external web services. For some reason it seems that Apex is not recognizing the @future(callout = true) argument and give me the error: callouts from triggers are not supported (the methods are being invoked by a trigger). Things work fine once I remove the implementation of the interface from the class. I attached code snippets for each Apex class/trigger below:
I'll be extremely thankful if someone could help!
I created an interface, in which the classes that implement this interface has future methods for calling external web services. For some reason it seems that Apex is not recognizing the @future(callout = true) argument and give me the error: callouts from triggers are not supported (the methods are being invoked by a trigger). Things work fine once I remove the implementation of the interface from the class. I attached code snippets for each Apex class/trigger below:
I'll be extremely thankful if someone could help!
You are calling the methd "addUser" from the instance of a interface but not from the actual class name where the method is decalred as future.
ie, v.addUser instead use as slackIdentifyManagement.addUser(a.Id);
Hope it helps,
Thank You,
Rajesh Adiga P.
LinkedIn : https://www.linkedin.com/in/rajesh-adiga-p-b3611ba7/
Thank you for your help, that does solve the error by calling the actual class. However, I'm also trying to make the calling in the trigger generic for different classes, that's why I’m using the Type, which requires an interface to be instantiated, is there any way to achieve the same "reflection" with out using the instace of the genral interface?
Thank you!