Clock In Time vs Shift Start Time BPM

You could also try customizing the MES screen.


Below is an .exe code I put together using Visual Studio 2013 and importing  epicor's BO into visual studio. This exe is run as a job in SQL set for specific day and time. Therefore, inside of epicor, you could get the reference of a control and disable or enable that control based on time. Yes very doable via customization inside of Epicor if you know how to code it.


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Epicor.Mfg.BO;
using Epicor.Mfg.Core;

namespace ClockOutUser
{
    class Program
    {
        Session epiSession = new Session(
                                  "UserID", "Password",
                                  "AppserverDC://TGI-EPICORAPP:9411",
                                  Epicor.Mfg.Core.Session.LicenseType.Default);

        bool morePages = false;
        string empID = "StartEnd";

        static void Main(string[] args)
        {
            Program cou = new Program();
            cou.ClockOutEpicorUser();
        }

        public void ClockOutEpicorUser()
        {
            using (epiSession)
            {
                EmpBasic empB = new EmpBasic(epiSession.ConnectionPool);
                Labor lbr = new Labor(epiSession.ConnectionPool);

                empB.ClockOut(ref empID);

                lbr.GetRows("EmployeeNum = 'startend' and ActiveTrans = yes BY EmployeeNum", "", "", "", "", "", "", "", "", "", "", "", 0, 0, out morePages);
            }
        }

    }
}

I need help to set a BPM in the MES screen. the goal is to stop Employees from clocking in too early. 

i want to check the current Clock In time vs the
Start Time for the Employees Shift.

 

i am not sure of which Business Object  and Method to use. i did tracing and i get BO.EmpBasic   Method.ClockIn

BO.EmpBasic    Method.GetRows

BO.Labor Method.GetRows

BO.ReportMonitor Method.GetRowsKeepIdleTime

BO.EmpBasic Method.CheckShift


i have tested several of these with the Condition "number of rows in the query is not less than 1"

Code:

For each ttLaborHed where ttLaborHed.RowMod = ‘A’ no-lock , 

Each EmpBasic where Empbasic.Company = Cur-Comp 

and EmpBasic.EmpID = ttLaborHed.EmployeeNum 

and EmpBasic.Shift = ttLaborHed.Shift

Each JCShift where JCShift.Shift = ttLaborHed.Shift 

and JCShift.StartTime >= ttLaborHed.ClockInTime no-lock


any help or advise is appreciated


Did you ever get this working? 

We need to do the same.

Tim Lester