How to fetch values in Child table from Parent custom script

Hello Everyone,

I have made a Parent “DocTypeA” and inside that I have added a child table “DocTypeB” with 4 fields. The first field is a link to “Employee” doctype. The other fileds are ‘Salutation’, ‘employment type’ and ‘date of joining’. Now I want that the values of the three fields be fetched automatically when I select The Employee from the link. It seems very easy and I added this code in custom script of child table “DocTypeB”:

cur_frm.add_fetch(“employee”,“salutation”,“salutation”);
cur_frm.add_fetch(“employee”,“employment_type”,“employment_type”);
cur_frm.add_fetch(“employee”,“date_of_joining”,“date_of_joining”);

But I came to know that custom script does not work for child table. So how can I write the same script from the parent “DocTypeA” custom script??

Someone, please help me if they know how to do this…
Thanks

I am late, but this may help others
https://docs.erpnext.com/docs/user/manual/en/fetch%20value%20in%20child%20table%20field

frappe.ui.form.on("Sales Invoice Item", "batch_no", function(frm, cdt, cdn) {
    var d = locals[cdt][cdn];
        frappe.db.get_value("Batch", {"name": d.batch_no}, "expiry_date", function(value) {
            d.expiry_date = value.expiry_date;
        });
});