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
Madhuri LondheMadhuri Londhe 

Can I use @AuraEnabled and @Future Annotations on same method?

 @AuraEnabled
    @Future(callout=true)
    public static void makePostCallout(String reqId) 
    {}

Can I do this?
I am not getting any error for this.
I need to call this method from trigger as well as lightning component.
Best Answer chosen by Madhuri Londhe
Khan AnasKhan Anas (Salesforce Developers) 
Hi Madhuri,

Greetings to you!

Yes, you use @future annotation with @AuraEnabled annotation. Please refer to the below link for more information.

https://salesforce.stackexchange.com/questions/239994/auraenabled-method-will-execute-in-synchronous-or-asynchronous

I hope it helps you.

Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.

Thanks and Regards,
Khan Anas