+ Start a Discussion
Pranav S SanvatsarkarPranav S Sanvatsarkar 

How to stop recusrion of queued jobs?

Hello there,

Scenario,
  • I have a ContactTrigger which enqueues a Queueable Job
  • I updated contacts through Batchable Apex to see the behaviour
Result
  • Batch execution is successful
  • Queued job is recursively getting executed and I am not able to stop this recursion
Need help :(

Thanks in advance.
Ranu Agarwal iBirdsRanu Agarwal iBirds
Pranav,
You can handle recusrion of trigger, so job will not execute in queue. Please refer this link : https://help.salesforce.com/apex/HTViewSolution?id=000133752&language=en_US
Hope that helps :)
Waqar Hussain SFWaqar Hussain SF
use condition in you trigger
system.isBatch() == true