I need to change amount calculation for each item in sales invoice to be:
amount = rate * qty * custom_field
I tried this, but it doesn't work.
frappe.ui.form.on("Sales Invoice Item", "custom_field", (frm, cdt, cdn) => {
var d = locals[cdt][cdn];
frappe.model.set_value("amount", d.qty*d.custom_field*d.rate) ;
});