In Material request doctype i need to set the warehouse address when the source and target warehouse is selected. For that I have made a client script but it is not working.
frappe.ui.form.on('Material Request', {
set_from_warehouse: function(frm) {
if(frm.doc.set_from_warehouse) {
frappe.db.get_value('Warehouse', frm.doc.set_from_warehouse, 'address_html', (r) => {
if(r.address_html) {
frm.set_value('custom_source_warehouse_address', r.address_html);
}
});
}
}
});
How can I do it?