Hi All,
To validate the Date in Purchase order, I wrote a custom script like this
frappe.ui.form.on(“Purchase Order”, “validate”, function(frm){
if(frm.doc.transaction_date < frappe.datetime.get_today()){
frappe.msgprint(__(“You can not select past date in From Date”));
frappe.validated = false;
}
});
But it doesn’t work. It shows the message and document is saved in past date. It should not save with past date. Kindly help me.