Could someone help me out with this? I’m getting no errors to point me in the right direction, but this script’s not working and it won’t allow the document to save.
This script was working in V7, but has stopped in V11
frappe.ui.form.on("Purchase Order", {
validate: function(frm) {
frm.doc.items.forEach(function(d) {
doc = {
"doctype": "Batch",
"batch_id": (frm.doc.name + " (" + d.item_code + ")"),
"item": d.item_code
};
frappe.call({
"method": "frappe.client.insert",
"args": {
"doc": doc
}
});
});
}
});