frappe.ui.form.on(“test”, {
customer: async function(frm) {
const options = await get_custom_items(frm);
console.log(options);
console.log(“helo”,options);
const data = frm.fields_dict(“ref_code”).grid.get_field(“xyz”);
data.set_data([“abc”, “def”, “ghi”]);
}
});
function get_custom_items(frm) {
return new Promise((resolve, reject) => {
frappe.call({
method: “abc.abc.doctype.test.test.get_options”,
args: {
“customer”: frm.doc.customer
},
callback: function(response) {
if (response.message) {
resolve(response.message); // Return fetched data
} else {
reject(“Error fetching data”);
}
}
});
});
}
----> Above code is properly working for normal field and field type is autocomplete but it is not working for child table field so could anyone provide a solution for this issue?