Need help creating BPM to close job when final operation completed

looking for more help concerning BPMs. Any guidance is greatly appreciated…

What i need to happen: When the operator clocks out of the Final Operation and marks it completed and submits it in MES, i need epicor to mark the job complete. I have already DMT’d which operations are marked as Final Operations but that field doesn’t exist within the job oper table (in-trans data directives) so i cant call on it. Is this something that can be done with the BPM “bubbles/modules” or would i need to use the “Execute Custom Code” bubble?

There are processes for this called Auto Job Completion and Auto Job Closing. These can be set to run on a schedule, would those accomplish what you are looking for?

The Final Operation is found in the JobAsmbl table.

1 Like

I can help you out with that.
I have a BPM that closes the job when all operations are completed.
We use it for our WBS Phase jobs.

I can attach the BPM if you wanna load it in your test app server to play around with it.

ClosePhaseJobs.092518.bpm (56.2 KB)

Some specific notes:

  • I’m not looking for the final op, I’m looking at all operations are completed to exclude the chance that someone completed something out of order.
  • The pre processing is checking for project jobs; you would need to change yours to production jobs. (Change the “J” to “P” and remove the phaseID check
  • Our CAD and Designers have a zero labor rate because we use the phase jobs to track time, but don’t want to apply cost. There’s a check in the post processing that checks their labor rate and, if not zero, sends an email. You can remove that entirely.
4 Likes

Hi Hannah,

I am trying to modify the BPM. Any help is definitely appreciated.

What I am trying to do is modify the BPM to close after All Operations are Complete and Shipped Complete. I am using your “ClosePhaseJobs” but am hitting a wall. Can you provide assistance?

What issues are you running into?

I am not sure how to add the “Shipped Complete” check into the BPM since it is part of the ShipDtl table and not part of the LaborDtl table.

Something like this (modify as needed):

int complete = (
    from jo in Db.JobOper
    join sd in Db.ShipDtl on new {jo.Company, jo.JobNum} equals new {sd.Company, sd.JobNum}
    where jo.Company == Session.CompanyID &&
          jo.JobNum == job &&
          jo.OpComplete == true &&
          sd.ShipCmpl == true
    select jo.OprSeq).Count();  

That would look at all job operations that have a corresponding shipment line that is shipped complete.

That would replace this in the custom code:

That’s perfect, almost. So we complete all ops before shipping complete. Any way we could check that all conditions are met after “shipping complete?”

Thanks so much for your help!

That is unless you know of a way to be able to ship closed jobs?

You would have to move it from the Labor.SubmitForApproval BO to the CustShip.Update (probably) one and do your checks there.

Ok great, Thanks again for all the help!

1 Like

Ok, As you have probably figured out by now I am not a coder, I don’t have a clue on how to get this to work. Would you mind assisting? I don’t know if this is against the rules here but I’d be willing to take this offline and discuss further including a consult fee.