Before_cancel validation script

I want to run this script before cancel, but its running after cancel?

frappe.ui.form.on("Journal Entry", "before_cancel", function(frm) {
        frappe.confirm('Are you sure? JV# has clearance date',
                              show_alert('block one')
                          show_alert('block two')

Yes, it is a bug, it should run before cancel even occurs.

@kolate_sambhaji you should be able to contribute a fix.

1 Like

@rmehta @kolate_sambhaji Is this fixed. I just faced same issue.

Using frappe.confirm is not blocking further execution will results in that above function is getting called after cancel API call.

Hi any update on this? Or is there a way we can change the text of Cancel Prompt

0_8011 (1)