Sum in BOM Item Table with custom script

I am trying to do sum of two custom field’s value and set it to quantity field in Item child table(MATERIALS) of BOM. I have tried below code but it’s not working. My two new fields are cutte and pick. My code is

frappe.ui.form.on(“BOM Item”, “qty”, function(frm, cdt, cdn) {
var child = locals[cdt][cdn];
child.qty= (child.cutte * child.pick);
frappe.model.set_value(cdt, cdn, ‘qty’);
});

Hi @munim , try this

frappe.ui.form.on("BOM Item", "cutte", function(frm, cdt, cdn) {
       var d = locals[cdt][cdn];
       frappe.model.set_value(cdt, cdn, "qty", d.cutte * d.pick);
});

frappe.model.set_value(cdt, cdn, ‘qty’, ‘child.qty’);