changed from label based to fieldname based
diff --git a/erpnext/hr/doctype/employee/employee.js b/erpnext/hr/doctype/employee/employee.js
index d0c2fba..98f9f6e 100755
--- a/erpnext/hr/doctype/employee/employee.js
+++ b/erpnext/hr/doctype/employee/employee.js
@@ -57,11 +57,7 @@
frm.events.update_contact(frm)
},
update_contact:function(frm){
- for(var i =0, j=frm.fields.length;i<j;i++){
- if (frm.fields[i].df.label===frm.doc.prefered_contact_email){
- frm.set_value("prefered_email",frm.fields[i].value)
- }
- }
+ frm.set_value("prefered_email",frm.fields_dict[frappe.model.scrub(frm.doc.prefered_contact_email)].value)
}
});
cur_frm.cscript = new erpnext.hr.EmployeeController({frm: cur_frm});