Child Table Calculation

can you help me on this?


Hi, I have this childtable like this. And I try your script but it doesn’t work. Pls help me?
Here my cript:
frappe.ui.form.on(“Output Total Amt”, “amt_a_tax”, function(frm, cdt, cdn) {
var item = locals[cdt][cdn];
var result = tt_amt + tax + amt_0_tax;
item.amount_a_tax = result;
});

Preformatted text@H_nh_Nguy_n

let total = 0;
let items = frm.doc.[child table field name];
for (let i = 0; i < items.length; i++) {
    total += items[i].[field_name to sum up];
}

    // Total Amounts Section

    frm.set_value([parent doctpe field name], total);
2 Likes

Can I call the sum in other child table?