here employee name is virtual field.
When refreshed, i got not saved status.
here is the code
f
rappe.ui.form.on("Logi360 Employee and Branch", {
refresh(frm) {
updateName(frm);
},
employee_id(frm) {
updateName(frm)
},
});
function updateName(frm) {
if (frm.doc.employee_id) {
frappe.call({
method: "frappe.client.get",
args: {
doctype: "User",
name: frm.doc.employee_id
},
callback: function (data) {
if (data.message) {
//frm.fields_dict.employee_name.set_value(data.message.full_name);
frm.set_value("employee_name", data.message.full_name);
}
}
});
}
}