function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Jimmy ThakkarJimmy Thakkar 

Create an action on Apex Job Abort

Hello Guys,

I want to update my custom object records; whenever the Apex Job is being Aborted forcefully. As we know that Batch class finish method will be called whenever the Job will be completed. But my action should be fired whenever the Apex Job is being Aborted forcefully.

Thanks.

Jimmy ThakkarJimmy Thakkar

To be precise; 

Let's say I'm getting 1000 Records through Apex Class into Batch class in the form of 10 Chunks (100 * 10). 2 Chunks are being executed by Apex Job and while Processing 3rd one; I'm forcefully Acorting the Apex Job. At that my custom object record should get updated.

Thanks.