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.


Try this code:

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

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: