I have three child tables inside my parent Doctype.
that child table have three coloums, for example a b and c
if enter a = 5 and b = 5, it will automatically calculate and set c to 10
How do I do this??
my child table doctype is like Addition
child table field name are add1 add2 and add3
Hy @nelson_d
Try this code
frappe.ui.form.on('Child Doctype', {
a: function(frm,cdt,cdn) {
table_ttl(frm,cdt,cdn);
auto_cal(frm);
},
b: function(frm,cdt,cdn) {
table_ttl(frm,cdt,cdn);
auto_cal(frm);
}
});
function table_ttl(frm,cdt,cdn){
var row = locals[cdt][cdn];
frappe.model.set_value(cdt,cdn,"c",row.b+row.a)
}
I hope it’s working
Thank You!