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.
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) {
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");
}
});
},
});