Automation of Start and End Labor Activities with Job Batching and Co-Parts

Hi all, I’m hoping someone can help with a project we are trying to do. We are using the E10 Advanced Production Module and are Batching jobs and everything is working great on that. The problem we have is that in order to get the costs associated with the parts we need to go through the Start and End Labor Activities and add the quantities into the Co-Parts screen on the End Activity process. This works and gives us our costs ok but we would now like this to be an automated process that would trigger when we do a Mass issue to manufacture. To that end, we decided to go through Time and Expense entry and trace what happens during that process. I’ve created a method directive on MassIssueToMfg and added in the Invoke BO Methods to try and recreate what is happening when we do the T&E process (as per the trace log) but I’m way out of my depth and struggling to achieve the desired/ any outcome. We have an Epicor Consultancy firm that helped us set up Epicor looking at this issue also but feel we are not getting any progress from them and are not confident on a resolution from them. I’m hoping someone on this fine forum will be able to help. (I’ll try to attach the trace data also). Thanks.
TraceData20600.rar (85.1 KB)

When you have Co-Parts, and you end activity, there is a requirement to specify how many of each co-part you actually completed. I know that I tried to automate this once, but was unsuccessful, and the customer decided to train their users because there was some variances they needed to account for anyway. Batching creates Co-Parts as well, so it has the same results.

1 Like

Thanks Tim. I know it’s a big ask to do what we are attempting. Our plan was to set the co-parts value to the same Prod Qty value from JobProd that was on the batched jobs. If I had a better grasp on C# I’m sure we could write code to set the LaborPart.PartQty for each Part on the batch job to be the same value as JobProd.ProdQty during the EndActivity process. If I even had some help or code examples for doing the Start Activity and End Activity processes (regardless of co-parts being input) I’m sure my colleague and myself can muddle through adding in the rest of what we need to do. (The idea of what we need to do and the logic required to do it works in my head, I just need help converting it to C#). Essentially we want to Start Activity on a Batched Job and then End Activity on that same batched job while inputting the Co-Parts Quantities and do all this with either with a button click or on the MassIssueToMfg BO PerformMassIssue. Any help would be appreciated.

After a few days off and a lot of head scratching, I think we have come up with a solution to our problem. I’ll post it here for anyone that wants to see how we done it in the hope that it may help anyone else trying something similar.

We wanted to run something that would complete the Co-Parts on a batched job automatically and so were looking at Start and End Activity and adding Co-Parts, we then found that we didn’t need to Start and End Activity if we used Time and Expense Entry instead. So we ran a trace on this process and found the details that changed were in the Business Object ReportQty.

This led us to looking at Invoking a BO on the Method Directive MassIssueToMfg - PerformMassIssue - Post-Processing.
In Usings and References we added in a new assembly in references Erp.Contracts.BO.ReportQty
image

We also created a Variable called tsReportQty:

We then built the process as in the image below:


(The 2 show message boxes were just for testing purposes and can be ignored)

The first Fill Table By Query is for the ReportQty method and we are creating a ParameterQuery using just the Erp.JobPart table with the display fields and Mappings as in images below:




(The JobNum in the mappings above is coming from the MassIssueToMfg and the var: pcJobNum was created by that and not by me)

The Second Fill Table By Query is for the ReportQuantityPart Method (for the Co-Parts) and we are again creating a ParameterQueryPart using just the Erp.JobPart table with the display Fields and mappings as in images below:




The important fields for the Co-parts to get updated are CurrentQty and TotalQty. We just set these to the same Value as the JobPart.PartQty field.

Finally we then Invoke the BO Method to fill in the ReportQty.


image

This has allowed us to get the Job Costs on completion of the Co-Parts when we do a Mass Issue.

This won’t be for everyone but hopefully it will help some or at least point you in the right direction. Good Luck.

1 Like