Activity Forums Salesforce® Discussions Can a Salesforce trigger call a batch class in Salesforce?

  • Charan Tej

    Member
    July 29, 2018 at 4:52 AM

    Yes we can invoke. But make sure you are not crossing the governing limits.

    The current limit for concurrent batch jobs is 5.

    https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_gov_limits.htm

  • [adinserter block='9']
  • Parul

    Member
    September 14, 2018 at 4:48 AM

    Yes, you can call the batch class using trigger but there must be a governor limit. And you need to ensure it does not cross the governor limit.

     

    Thanks

  • shariq

    Member
    September 14, 2018 at 6:24 AM

    Hi,

    You can call a batch from a trigger, but you need to be aware of potential limits you could hit.

    You can only have 5 batch jobs queued or executing at once. If your trigger calls batch jobs each time, then you could quickly exceed that limit.

    Hope this helps!

Log In to reply.