I want to run this script before cancel, but its running after cancel?
frappe.ui.form.on("Journal Entry", "before_cancel", function(frm) {
if(frm.doc.clearance_date){
frappe.confirm('Are you sure? JV# has clearance date',
function(){
show_alert('block one')
},
function(){
show_alert('block two')
}
);
}
});