How to get the total qty in list item

i just want to get the total weight in the table

new user here… thanks

frappe.ui.form.on("Child Table Doctype Name", "field_name", function (frm, cdt, cdn) {
    var total = 0;
    $.each(frm.doc.child_table_doctype_name || [], function (i, d) {
        total += flt(d.field_name);
    });
    frm.set_value("total_weight", total);
});
2 Likes

thanks,