Before_cancel event

Hello, I’d like to use the event ‘before_cancel’ on the client script, but it doesn’t appear to be functioning. I tested this code, but received no response. Is anyone able to help? Thank you!

before_cancel: function(frm) {
    console.log("document cancel")
}

@Xent Please share the client script screenshot.
It is working.

image

image

1 Like

@Xent yes its working first trying to cancel doc then its working

1 Like

This is my script
image

My workflow

And the log
image

Refresh is working fine.

@Xent go to approved to cancelled state

I think it doesn’t work when the cancel button is in the workflow action. I tried to remove the canceled state from my workflow. It now works.
Thanks for the inputs.

Hi, don’t create complexity, use server script and set the action!