E10 Configurator Context value for Employee ID

(Graeme Ross) #1

I am working on an Inspection Plan in the configurator and wanted to extract the employee ID if this inspection plan is running on the MES. Does anyone know how to do that?

I can get the UserID from the context so maybe I could find what Employee number is logged in but this seems rather round about way to do this when it should be part of the context. This field might also be a good way to determine if someone is using the MES vs. the standard desktop to fill out the inspection plan.

Thanks for any help.



(Dan Edwards) #2

You can get the EmployeeID using the method below from client side code in the configurator. Instead of epiButton1 you could bind to any control you have on the form - just make sure to change the type (EpiButton) if not a button

string employeeId = ((Ice.Core.Session)((InputControlValueBound<Ice.Lib.Framework.EpiButton,string>)Inputs["epiPcButton1"].Value).Control.EpiTransaction.Session).EmployeeID;

(Graeme Ross) #3

Thanks Dan. I was able to determine this using other examples that I found. This is less code but I hope it functions that same way as what you are suggesting:

Inputs.ATC001_Clock_Nbr.Value = Session.EmployeeID;
// read Employee Name from table
Inputs.ATC001_Inspector.Value = “Not Available”;
var EmpBasicResult = (from row in Db.EmpBasic
where row.Company == Session.CompanyID &&
row.EmpID == Session.EmployeeID
select new { row.Name }).FirstOrDefault();
if (EmpBasicResult != null)
Inputs.ATC001_Inspector.Value = EmpBasicResult.Name;