Hi Team,
Is it possible to stop or cancel a job event execution while the job method is still running?
I’m specifically looking to handle this outside of the job method. I came across the method await $job.updateStatusMessage(), and I wanted to check if it can be used to interrupt or stop the execution of the job midway.
If not, is there any recommended approach to achieve this?
1 Like
Hi Santhosh,
$job.updateStatusMessage() does not cancel or interrupt a job. It only updates the job’s status message (and keeps the job in inprogress) so users can see progress in the UI. When the handler finishes, the platform still sets the final outcome (success / failure / timeout) as usual, and the last message you set during the run is superseded by that completion flow.
There is no supported way to stop a job from “outside” the handler while it is running.
Hope this helps