Fetch data from another doctype child table based on link field of that doctype

I want to display Designation Skill table data to employee doctype new child table Employee Skill based on field designation.

From Designation: Skill table => Employee: Sop Skill table.based on employee.designation.

@poojavadher,

Try this code:

frappe.ui.form.on('Employee', {
     onload: function(frm) {
        frappe.call({
			"method": "frappe.client.get",
			args: {
				doctype: "Designation",
				name: frm.doc.designation
			},
			callback: function(data){
				frm.clear_table('skills');
				let design = data.message.skills;
				for (var des in design) {
					var row = frm.add_child("skills");
					row.skill = design[des].skill;
				}
				frm.refresh_field("skills");
			}
		});
		
    },
});

Screenshot from 2022-12-13 10-37-10
This is my client script code


it show error like this when load employee doc.

@ERP_Implementer1 Thank you so much its working :+1: