Activity Forums Salesforce® Discussions Why we cannot call future method from batch class as we can do from Queable class in Salesforce?

  • Why we cannot call future method from batch class as we can do from Queable class in Salesforce?

    Posted by Prachi on September 27, 2019 at 11:23 am

    Why we cannot call future method from batch class as we can do from Queable class in Salesforce?

    • This discussion was modified 5 years, 2 months ago by  Prachi.
    Piyush replied 5 years, 2 months ago 2 Members · 1 Reply
  • 1 Reply
  • Piyush

    Member
    September 30, 2019 at 5:29 am

    Hi,

    You cannot call another future method from a future method. As per Salesforce documentation,
    You cannot call a method annotated with future from a method that also has the future annotation. Nor can you call a trigger from an annotated method that calls another annotated method.
    If you do not have dependency between f1 & f2, you can call both methods one by one from original class.

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos