Hi Everyone,
I was writing a custom script and wanted to validate some data using some logics.
frappe.ui.form.on("Time Log","validate", function(frm) {
var a=new Date(frm.doc.from_time);
var b=new Date(frm.doc.to_time);
a=a.getDate();
b=b.getDate();
if (a!=b)
{ msgprint("You cannot create the Time Log across dates!");
throw "not allowed"; }
});
Everything is working fine except the throw "not allowed";
The moment control reaches here, save button get grey/disabled and at that time, I am not able to save the time log by changing the data.
Does, anybody have some idea about this?
Regards
Ruchin Sharma