MES - Start Production Activity - BPM

Hello,

My job tasked me with checking for open DMRs when a user starts an activity (MES -> Start Production Activity). I figured I could use Labor.StartActivity, but I noticed that fires (pre and post process) right after a user enters a job number, which is a problem because I need to know the operation sequence.

I am still new to Epicor customizations, so maybe in this case a BPM isn’t the right solution? I figured I could write form customization to handle the check (when the user clicks the ok button), but then I’ll need to write form customization for the Work Queue, which is why I was hoping to have the BPM handle the check and pop up a message to the user.

As always thank you for the help, the community here has been super helpful and it is very much appreciated!

@rfleischmann if you want the message when the user clicks ok in start activity that is Labor.Update.

I did a trace and there is a lot of activity after the operation is entered, but it all seems to be hidden.

Greg

1 Like

The best bet is to run a trace to see what methods are being called. In this case, it is likely something like “ChangeJobOper”. You may need more details in your criteria (like LaborQty=0 and LaborHrs=0), but it should work there. As a side note, be sure not to join the ttLaborDtl table to the Db.DMR* tables in a query. It is REALLY bad on performance.

1 Like

@gpayne Thank you! I was also thinking to attach to Labor.Update, I am going to give that a try. I agree there is a lot of activity, and what is strange is how the trace for StartActivity shows a lot of Labor detail records for other jobs other than the one I entered when starting the production activity.

Thanks @Jason_Woods, I did run a trace when I ran the Start Production Activity process, and the only methods I saw that were tied to Labor were:
GetList, GetByID, StartActivity, DefaultJobNum, CheckResourceGroup, OverridesResource, DefaultWCCode, LaborRateCalc, DefaultOprSeq, CheckWarnings, CheckEmployeeActivity, CheckFirstArticleWarning, Update, GetRows

Quick question, how would I know in Labor.Update if they are starting, or ending, an activity?

Thank you for the help!
Rob

@rfleischmann ttlaborDtl.Added() or ttLaborDtl.RowMod = “A” you also want LaborType =“P” for production and not I for indirect. If RowMod is U or ClockOutTime is not 24 then it is an out.

You might also be able to get this to fire post processing on CheckResourceGroup if you didn’t want to wait for the user to click OK.

1 Like

Thank you! Did you mean ClockOutTime is not 24? I am looking at the table now and I have long vales for ClockOutMinute but a labor record I ended activity has a ClockOutTime of 14.65 but a record that is currently in my active work queue’s ClockOutTime is 24. This is a big help btw, thank you!!

1 Like

@rfleischmann yes, should be ClockOutTime != 24

I edited the post to not leave bad info here.