frappe.ui.form.on("Sales Invoice", "type_of_customer", function(frm, cdt, cdn) {
var job = frappe.get_doc(cdt, cdn);
if (job.type_of_customer == "Retail Customers") {
cur_frm.set_value("retail_address", frappe.db.get_value('Contact', contact, 'address'));
}
})
I’m trying to fetch the address
field from Contact
doctype but it seems my code is not working.