Good morning Epicor community,
I have created a custom form using UD20 called “OT Entry” where management can go and submit OT approvals for employees that will be coming in early or staying late on any particular day. Employee name, OT Date, and OT amount are captured here. Also, when a new UD20 row is created, a BPM fires and sets a field in the UD20 table with the Employee’s EmpID (update table by query, EmpBasic (This is so I can join the UD20 table with others using EmpID later on)
I have written queries that compare the UD20 entries against payroll hours (Daily OT - Hours over 8 & Weekly OT - Hours over 40) to help management see what employees are milking the clock for an extra 10 min per day and which ones are actually working the OT that was asked of them. I have optimized this system to the point where it works very well and is helpful for managment. We have also modified Epicor’s punch in threshold to allow each shift a 9 min window for clock in
(5:51 AM rounds to 6:00 AM - 6:09 AM rounds down to 6:00 AM).
The owner wants to try and take this system and go a different direction with it. He wants me to look into finding a way to get to where if an employee tries to clock in before the 9 min threshold (< 5:51 AM), and does not have an OT Entry for that day (UD20 EmpID, OT Date, OT Amount), they are prevented from clocking in until 5:51 AM or later.
I’ve tried using data & method directives on the LaborHed.Update method, giving each shift its own automation to better control the logic in each, but have not been able to get it to function the way i’d like. Upon tracing, I saw that the EmpBasic.ClockIn method seems to be what actually clocks the employee in, so i’m also not sure if I’m even working with the right BO/Method, because I don’t even see the Labor.Update method being called in my trace, but I could be wrong. Here are some screenshots of my approaches using the Labor/LaborHed BO.
The approach is similar on both the data & method directive attempts. I’ve been able to throw the exception (although it’s a hit or miss), but I have not been able to get it to function where if an employee does not have OT for that day on a particular shift, don’t let them clock in before this time.
Does anyone have any suggestions or know of a different approach that could accomplish this?
I appreciate any help your can provide!