Creating a new labor detail (the right way)

I know this is a rather old thread but I’ve been banging my head against the wall trying to get the final piece of this to work. I can get the detail record in and I thought everything was fine until I took a closer look at the transactions. No matter what I try I can’t seem to get the Burden and Labor Hrs to populate. The Earned hours populate just fine but the others stay blank.


The first row is a standard manual transaction. The last 2 are done through my customization.
Here’s the relevant bit of code:

SearchOptions optsl = new SearchOptions(SearchMode.AutoSearch);
optsl.NamedSearch.WhereClauses.Add("LaborHed",whereSeq);			
optsl.SelectMode = SelectMode.SingleSelect;		
optsl.DataSetMode = DataSetMode.RowsDataSet;
LA.InvokeSearch(optsl);

LA.GetNewLaborDtl((Convert.ToInt32(LA.LaborData.LaborHed.Rows[0]["LaborHedSeq"].ToString())));

int rCount = LA.LaborData.LaborDtl.Rows.Count - 1;
decimal quant = Convert.ToDecimal(quantNE.Value);

LA.LaborData.LaborDtl[rCount].LaborQty = quant;
LA.LaborData.LaborDtl[rCount].LaborType = "P";
//LA.LaborData.LaborDtl[rCount].Rework = false;
LA.LaborData.LaborDtl[rCount].JobNum = jobTB.Text;
LA.LaborData.LaborDtl[rCount].OprSeq = opSeq;
LA.LaborData.LaborDtl[rCount].OpCode = operationCode;
LA.LaborData.LaborDtl[rCount].JCDept = jcDept;
LA.LaborData.LaborDtl[rCount].ResourceGrpID = rgID;
LA.LaborData.LaborDtl[rCount].ExpenseCode = expCode;
LA.LaborData.LaborDtl[rCount].LaborNote = "Quantity Only";

LA.EndActivity();
EBA.ClockOut(ref employee);
LA.Update();

There are probably some helper methods you are missing. Start a trace and then run the process manually to figure out what is missing.

Thanks for the reply. I have run a trace of the Report Quantity (MES) process and it could honestly not be less helpful. There is almost no mention of the Labor tables at all. That’s why I’ve had to dig around through here in order to get as far as I have. You mentioned in your original post that there were some fields that you changed that were not shown. Do you happen to notice any particular fields that I’m missing? Were there any helper methods you needed to use since your labor and burden hours both posted in your example here? Thanks again.

You should trace a qty report within T&E. ReportQty works a little differently.

Also, are you setting RowMod = “A”?

1 Like

I’ll try that. Thanks.
I have tried with and without the rowmod.

Hi @Chris_Conn, @jasond
is not missing [LaborDtlSeq] ?, it is a required parameter to create LaborDtl record as well as [LaborHedSeq] and i can not see it in your code

image

The DetailSeq is autogenerated for you when you GetNew