Hi Nabinhait,
I have tried the following script by changing the field type to float, table and data but none work. Is my script wrong ?
Thank you in advance !
frappe.ui.form.on(“Purchase Order Item”, “qty”, function(frm, cdt, cdn) {
// code for calculate total and set on parent field.
total_qty = 0;
$.each(frm.doc.items || [], function(i, d) {
total_qty += flt(d.qty);
});
frm.set_value(“UOM”, total_qty);
});