Hello. We have a certain operation where we have operators briefly clocking in and out just to claim their pieces. They’re on indirect so we don’t care about the labor hours on these jobs. However, we do care about the burden hours. So we needed a way to capture this value at the same time the labor entry is submitted.
I tried several different ways to do this, but no luck yet. My current trial involves a custom EpiNumericEditor box on the End Activity screen for “Burden Hours” that’s tied to a UD field to temporarily hold the BurdenHrs value for that LaborDtl record. I figured maybe I could mimic the steps I take within Time and Expense Entry to update the Burden Hours. So, I ran a trace on these steps and using the Trace Parser from @josecgomez (love it!), I could see all the objects and methods being called.
The first one I’m stuck on is LaborImpl.RecallFromApproval. When you recall a labor transaction from the UI, it appears to be recalling a single LaborDtl record, not the entire LaborHed record or dataset. So, why would the RecallFromApproval method only have one parameter for the entire LaborDataSet? How would it know which record needs recalled? See my screenshot below from the BL Tester with multiple LaborHed and LaborDtl records coming back from the RecallFromApproval method.
Or if anyone has a better solution for this, I’m all ears!
P.S. We are currently on 10.2.300.11.
I’m guessing when you do Recall there’s a RowMod on the record you are recalling. So you pass the whole dataset but the one Row that is getting recalled has a RowMod… (I’m guessing here but that’s how some of the other BO’s work)
What does the Diff look like in the tracer utility on that call?
Oh, I see what you mean now. The RowMod of 1 of the records is “U” and the TimeStatus is changed from “A” to “E” for that record. So, if that’s the case, how do I manually set RowMod, TimeStatus, and other fields of the 1 LaborDtl record that I need to recall within a BPM (using “Invoke BO Method”)?
Ok, I need some more help please friends.
I have a post-proc method BPM that sets some variables, does a GetByID for the current LaborDataSet, Executes Custom Code, and then Calls the Labor.RecallFromApproval method. The BPM is updating data in the table as expected, but I’m getting an error that says “The table ds.LaborDtl has more than one record” when the BPM fires. It still does what it’s supposed to, but I’m not seeing what is causing this error. I figured by updating only the current LaborDtl record, I wouldn’t be getting this error. I’ve narrowed it down to my Execute Custom Code block. It’s shown below. Does anyone see anything wrong with my code? Thanks for any advice!
Erp.Contracts.LaborSvcContract Lbr = Ice.Assemblies.ServiceRenderer.GetService<Erp.Contracts.LaborSvcContract>(Db);
var LaborDataSet = new Erp.Tablesets.LaborTableset();
LaborDataSet = Lbr.GetByID(LaborHedSeq);
foreach (var LaborRow in LaborDataSet.LaborDtl)
{
if (LaborRow.LaborDtlSeq == LaborDtlSeq)
{
LaborRow.RowMod = "U";
LaborRow.TimeStatus = "E";
LaborRow.BurdenHrs = CurBurdenHrsTemp;
}
}
Lbr.Update(ref LaborDataSet);
I’m trying to do something similar and came across this when checking if anyone has done it already.
Maybe try just selecting the one LaborRow at a time (Setting the LaborRow.RowMod = “U”) for update?
Also, rather than setting TimeStatus=“E”, I think that’s what RecallFromApproval should do. Correct me if I’m wrong.
From the trace, I think what needs to be done is:
Labor.GetByID - to get the LaborDataSet
Set the RowMod to ‘U’ for the LaborDtl you want to update in the LaborDataSet
Pass the LaborDataSet into Labor.RecallFromApproval
Update the BurdenHrs for the LaborDtl record with RowMod of “U”
Pass the LaborDataSet into method Labor.Update
Pass the LaborDataSet into method Labor.SubmitForApproval