I’m trying to update a custom field in the ‘Asset Repair Consumed Item’ child table in the Asset Repair Document when the consumed_quantity field is set.
This is my script.
frappe.ui.form.on(‘Asset Repair Consumed Item’, {
consumed_quantity: function(frm, cdt, cdn) {
msgprint(“Script is triggered”)
var d = locals[cdt][cdn];
frm.refresh_field(“available_quantity”)
frm.set_value(‘available_quantity’, “hello world”);
}
});
The script executes, but it says available_quanity field does not exist. I’ve already added it as a custom field in the Asset Repair Consumed Item DocType. What am I doing wrong?