Try ERPNext Try Frappe Cloud Buy Support Partners Foundation

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