Hi,
I am doing script for our doctype where in the specific field from the child table will throw a mandatory error once the workflow status of the doctype is ‘For Checking’
I’ve tried doing this, but it’s not working
frappe.ui.form.on(‘Service Schedule’, {
refresh(frm) {
frappe.ui.form.on("Service Stops", 'distance', function(frm, cdt, cdn){
if(frm.doc.workflow_state == ' For Checking'){
frappe.throw({
title: __('Error'),
indicator: 'red',
message: __('Please input Distance')
});
validated = false;
}
});
}
})