We need help, please let us know if anyone has a solution. We have created a client script, but it is not working.
In the Quotation Item child table, we’ve added two columns: Length and Width. We would like to enter values for these fields and have them multiplied to automatically update the Quantity field.
frappe.ui.form.on(‘Quotation Item’, {
custom_length: function(frm, cdt, cdn) {
let row = locals[cdt][cdn];
console.log('Custom Length: ', row.custom_length, 'Custom Width: ', row.custom_width);
if (row.custom_length && row.custom_width) {
row.qty = row.custom_length * row.custom_width;
cur_frm.refresh_field(‘items’);
}
},
custom_width: function(frm, cdt, cdn) {
let row = locals[cdt][cdn];
console.log('Custom Length: ', row.custom_length, 'Custom Width: ', row.custom_width);
if (row.custom_length && row.custom_width) {
row.qty = row.custom_length * row.custom_width;
cur_frm.refresh_field(‘items’);
}
}
});