Child DocType row "name"

How to fetch the last inserted child table row name ?

Do you want the name from the previous row? then apply it.

so please check the syntax.

frappe.ui.form.on('Parent Doctype', {
    child_table_field_add: function(frm, cdt, cdn) {
        let child_table = frm.doc.child_table_field;
        
        if (child_table && child_table.length > 0) {
            let last_row = child_table[child_table.length - 1];
            console.log("Last inserted child row name:", last_row.name);
        } else {
            console.log("No child table rows found.");
        }
    }
});
1 Like

Thanks for the support …