Trigger Event on MES Login

I want to trigger an event when a user logs into MES, so when they put in their employee ID and select a shift.
The only event trigger I have gotten to work is when Employee ID is changed but it doesn’t work outside of testing in customization mode. I was looking to use LaborHed.EmployeeNumName because that field changes in both my testing and in the deployed version, but I can’t get it to trigger. I’m just using a messagebox to show whether or not it is being activated. Anyone have any ideas of Form Events that would work?

when someone logs in or out (i assume you are attempting a client side event and not server) epiviewnotification should fire, test the row for >-1, could even take it one step further and test for string values of employee name or ID to not be empty or null? What are you attempting to accomplish? Maybe a server side method might work?

Basically I am using it so I can open up either the start production activity or end activity screen right after they scan their ID. I already have that code working I just can’t find the right form event to put my method call in.
Right now I have tried these

labordtl is on employeeName and LaborHed is on employeeNum and employeeNumName

none of them are working for me.
Here’s the code, just without the line “StartForm();” *
I think this is all client side

*and some timer code cause things were happening too fast

Brian change it from AddRow to Initialize in the code above that should fire

I put this code in there but now it’s just looping opening the start production activity and I can’t get out of it.

t.Interval = 1500;
t.Tick += new EventHandler(StartForm);

I put it under edvAutoAttachEmpBasic_EpiViewNotification but not in the if statement.

The notify event will trigger every time there is a change in the dataview. Just do a check to see if you’ve launched the form and then don’t do it. Don’t use a Timer.

How would I check that the form is already open?

Set a flag when you launch it to true

what do you mean by flag exactly?

do notifytype.initialize. By flag he means a boolean variable (true/false)

Oh ok that’s kind of what I thought. Is there a way to capture the form being opened somewhere? I had the bool set to true in StartForm() but it is wanting to press the button before it is actually clickable.

I tried adding
public void btnStartActivityProduction_Click(object sender, EventArgs args)

but it doesn’t register. I noticed you couldn’t add button click events from the wizard for native controls so I figure that might be it.

I don’t think @josecgomez or @rbucek could give you the answer any other way please re-read what they posted.

EpiViewNotification NotifyType.Initialize will get you there.

1 Like