Hi Community,
I was trying to create a POST request for Employee Checkin but encountered the following :
frappe.exceptions.ValidationError: No Employee found for the given employee field value. ‘attendance_device_id’: ‘HR-EMP-00005’
PS: I do have employee ‘HR-EMP-00005’ in my system.
Traceback:
File “/home/frappe/benches/bench-version-13-2020-07-02/apps/frappe/frappe/app.py”, line 64, in application
response = frappe.api.handle()
File “/home/frappe/benches/bench-version-13-2020-07-02/apps/frappe/frappe/api.py”, line 58, in handle
return frappe.handler.handle()
File “/home/frappe/benches/bench-version-13-2020-07-02/apps/frappe/frappe/handler.py”, line 30, in handle
data = execute_cmd(cmd)
File “/home/frappe/benches/bench-version-13-2020-07-02/apps/frappe/frappe/handler.py”, line 69, in execute_cmd
return frappe.call(method, **frappe.form_dict)
File “/home/frappe/benches/bench-version-13-2020-07-02/apps/frappe/frappe/init.py”, line 1085, in call
return fn(*args, **newargs)
File “/home/frappe/benches/bench-version-13-2020-07-02/apps/erpnext/erpnext/hr/doctype/employee_checkin/employee_checkin.py”, line 61, in add_log_based_on_employee_field
frappe.throw(_(“No Employee found for the given employee field value. ‘{}’: {}”).format(employee_fieldname,employee_field_value))
File “/home/frappe/benches/bench-version-13-2020-07-02/apps/frappe/frappe/init.py”, line 396, in throw
msgprint(msg, raise_exception=exc, title=title, indicator=‘red’, is_minimizable=is_minimizable)
File “/home/frappe/benches/bench-version-13-2020-07-02/apps/frappe/frappe/init.py”, line 375, in msgprint
_raise_exception()
File “/home/frappe/benches/bench-version-13-2020-07-02/apps/frappe/frappe/init.py”, line 326, in _raise_exception
raise raise_exception(msg)
frappe.exceptions.ValidationError: No Employee found for the given employee field value. ‘attendance_device_id’: HR-EMP-00003
This is the attendance_device_id field which takes employee_field_value in Employee, this number should be same for the employee in your Attendance Device.