Fetching from other doctype's child table

Hi,

We added some field for our company needs. We can’t seem to figure out why we can’t fetch a field from other’s child table.

Under is the simple script.

frappe.ui.form.on(“Supplier”, “onload”, function(frm, cdt, cdn, doc, dt, dn){
cur_frm.add_fetch(“supplier”, “payee_name”, “company”);
cur_frm.add_fetch(“supplier”, “account_number”, “account_number”);
});

When Supplier is chosen payee_name and account_number automatically appears. Please refer to the picture.

@rohit_w, could you reply ?

remove above code(including onload function) and add below code

cur_frm.add_fetch("supplier", "company", "payee_name");
cur_frm.add_fetch("supplier", "account_number", "account_number");

Thanks

1 Like

@rohit_w @pawan Works great! Thank you so much!