# MES - Start Production Activity - BPM

**URL:** <https://www.epiusers.help/t/mes-start-production-activity-bpm/74295>\
**Category:** Epicor ERP 10\
**Tags:** bpm\
**Created:** [January 8, 2021, 10:02pm UTC](https://www.epiusers.help/t/mes-start-production-activity-bpm/74295 "2021-01-08T22:02:51Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![rfleischmann](https://www.epiusers.help/user_avatar/www.epiusers.help/rfleischmann/32/37305_2.png) [@rfleischmann](https://www.epiusers.help/u/rfleischmann)\
**Post date:** [January 8, 2021, 10:02pm UTC](https://www.epiusers.help/t/mes-start-production-activity-bpm/74295/1 "2021-01-08T22:02:51Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![gpayne](https://www.epiusers.help/user_avatar/www.epiusers.help/gpayne/32/55751_2.png) [@gpayne](https://www.epiusers.help/u/gpayne)\
**Post date:** [January 8, 2021, 10:47pm UTC](https://www.epiusers.help/t/mes-start-production-activity-bpm/74295/2 "2021-01-08T22:47:42Z")

</div>

@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

---

<div class="post-metadata">

**Author:** ![Jason\_Woods](https://www.epiusers.help/user_avatar/www.epiusers.help/jason_woods/32/80101_2.png) [@Jason\_Woods](https://www.epiusers.help/u/Jason_Woods)\
**Post date:** [January 10, 2021, 7:13am UTC](https://www.epiusers.help/t/mes-start-production-activity-bpm/74295/3 "2021-01-10T07:13:48Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![rfleischmann](https://www.epiusers.help/user_avatar/www.epiusers.help/rfleischmann/32/37305_2.png) [@rfleischmann](https://www.epiusers.help/u/rfleischmann)\
**Post date:** [January 11, 2021, 1:45pm UTC](https://www.epiusers.help/t/mes-start-production-activity-bpm/74295/4 "2021-01-11T13:45:38Z")

</div>

@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

---

<div class="post-metadata">

**Author:** ![rfleischmann](https://www.epiusers.help/user_avatar/www.epiusers.help/rfleischmann/32/37305_2.png) [@rfleischmann](https://www.epiusers.help/u/rfleischmann)\
**Post date:** [January 11, 2021, 1:56pm UTC](https://www.epiusers.help/t/mes-start-production-activity-bpm/74295/5 "2021-01-11T13:56:30Z")

</div>

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

Thank you for the help!  
Rob

---

<div class="post-metadata">

**Author:** ![gpayne](https://www.epiusers.help/user_avatar/www.epiusers.help/gpayne/32/55751_2.png) [@gpayne](https://www.epiusers.help/u/gpayne)\
**Post date:** [January 11, 2021, 4:04pm UTC](https://www.epiusers.help/t/mes-start-production-activity-bpm/74295/6 "2021-01-11T16:04:26Z")

</div>

@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.

---

<div class="post-metadata">

**Author:** ![rfleischmann](https://www.epiusers.help/user_avatar/www.epiusers.help/rfleischmann/32/37305_2.png) [@rfleischmann](https://www.epiusers.help/u/rfleischmann)\
**Post date:** [January 11, 2021, 5:24pm UTC](https://www.epiusers.help/t/mes-start-production-activity-bpm/74295/7 "2021-01-11T17:24:13Z")

</div>

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!!

---

<div class="post-metadata">

**Author:** ![gpayne](https://www.epiusers.help/user_avatar/www.epiusers.help/gpayne/32/55751_2.png) [@gpayne](https://www.epiusers.help/u/gpayne)\
**Post date:** [January 11, 2021, 5:43pm UTC](https://www.epiusers.help/t/mes-start-production-activity-bpm/74295/8 "2021-01-11T17:43:02Z")

</div>

@rfleischmann yes, should be ClockOutTime != 24

I edited the post to not leave bad info here.
