Activity › Forums › Salesforce® Discussions › What problems you have encountered when calling Salesforce batch apex from a trigger?
Tagged: Apex Callouts, Apex Limit, Batch Jobs, Salesforce Apex Trigger, Salesforce Batch Apex, Salesforce batch Class, Salesforce Triggers
-
What problems you have encountered when calling Salesforce batch apex from a trigger?
Posted by Anjali on July 19, 2018 at 2:12 PMWhat are the problems you have encountered when calling batch apex from the trigger?
Avnish Yadav replied 7 years, 7 months ago 5 Members · 4 Replies -
4 Replies
-
Hii Anjali,
There is not a specific problem encountered while calling a batch from a trigger. But there are few limitations that we should keep in mind which calling the batch class. For instance, we can only have 5 batch jobs queued or executing at once. So we should be aware of the potential limits. If our trigger calls batch jobs each time, then we could quickly exceed that limit.
- [adinserter block='9']
-
hi anjali,
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.
-
future method call that performs more processing on the same record(s). The issue is that this entire process becomes recursive in nature and you receive the error “System.AsyncException: Future method cannot be called from a future method.
-
Hello,
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.
Thanks.
Log In to reply.