Child Table Link Field Population

can you expand your response in console that is giving Array 4

You are receiving none values. Why not you pass the exact fields because parent is not a docfield

so:

fields: ["docname"]

Is what I should do? Instead of:

fields: ["parent"],
parent: "Participant"

try with

fields=[‘name’,‘total’]

If you want link to your document then it can be get using name. Because reference to document is stored in this docfield


Okay so it’s pulling in the appropriate documents but its not adding them to the child table

now use docname

I did, same result.
fields:["docname"]

Use this code now

Share your code screenshot of js

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

Participant funding is your child doctype?

Nope it’s the parent for the child table which is called Invoices

I know. in actual participant funding is child doctype

Yes it’s the target

I am confused. This code is not populating the data

Yeap, it just refreshes the page. It is pulling the data, the issue lies with adding it to the child table

First tell me is Participant FUnding parent doctype or child doctype?

Parent: “Participant Funding”
Child table: “Invoices”