+ Start a Discussion
Ram chowdaryRam chowdary 

Stop batch process and automatically jump to finish() function

Good Evening,

I have created a batch process and inside the execute function, there is a condition. If a condition is meet, I want to stop the batch process and then call another batch process.

What i did at the moment is that I put System.abortJob() function. And call the batch process in my finish function. But when the condition is meet, the abortJob() will also stop the finish function being called therefore i won't call the other batch. I also try to call my other batch before the abortJob() but I will get an error that I cannot call a batch process inside the execute function. What is the other way to fix my problem ? please help.

Thank you...