I have added the following custom script in oppurtunity doctype and am expecting to see total_buy_price_dollar automatically getting updated when i change usd_unit_price. It does not work and am not sure exactly what i am doing wrong here. Please see my code below.
frappe.ui.form.on(“Oppurtunity Item”, {
usd_unit_price: function(frm, cdt, cdn) {
var d = locals[cdt][cdn];
var total = 0;
frappe.model.set_value(d.doctype, d.name, “total_buy_price_dollar”, d.usd_unit_price * d.qty);
}
});