Hi,
I want to fetch child table-phone_nos from Contact table into Customer doctype.
For that i have created a custom child table-custom phone with the same fields as in phone_nos and added it in customer doctype.
I used the below custom script,
frappe.ui.form.on('Customer', {
"refresh": function(frm) {
frappe.model.with_doc("Contact", frm.doc.refresh, function() {
var tabletransfer= frappe.model.get_doc("Contact", frm.doc.refresh);
$.each(tabletransfer.phone_nos, function(index, row){
var d = frm.add_child("Custom Phone");
d.phone = row.phone;
frm.refresh_field("Custom Phone");
});
});
}
});
I am getting the below error,
Kindly suggest to rectify this error.
Thanks in advance!