Please do help me.I would grateful.
I have created two doctype(childdoc and parentdoc)
I have link childdoc field docname with parent docname
so that as i choose parentdoc i wanna set firstnam and lastname of parent in child field.I have also attached doc field detail
following are code which i wrote child.js file.Please do correct me if i am doing wrong.Your help will be highly apcreciated
frappe.ui.form.on("child", {
docname(frm) {
frappe.msgprint("bwwhutan");
frappe.call({
method: "frappe.client.get",
args: {
doctype: "parentdoc",
name: frm.doc.docname,
},
callback: (r) => {
if (r.message) {
frappe.set_value("fname", r.message.fname);
frappe.set_value("lname", r.message.lname);
}
},
});
},
});