Child Table Link Field Population

frappe.ui.form.on("Participant Funding",{
    verify: function(frm, cdt, cdn){
        frappe.call({
        method:"frappe.client.get_list",
        args:{
            doctype:"Invoice PM",
            filters: [
                ["participant","=", frm.doc.participant]
            ],
        fields:["docname"]
    },
    callback: function (response) {
        if (response.message) {
            var row;
            for (row in response.message){
                var childTable = frm.add_child("Invoices");
                childTable.invoice =response.message[row]['docname'];
            }
            frm.refresh_fields("Invoices");
        }
    }
});

Verify is a button im using

1 Like