LaborAdapter.SelectForWork exception

What ref do I use for it?

The type or namespace name ‘LaborDataSet’ could not be found (are you missing a using directive or an assembly reference?)

using Erp.BO
You’ll need to bring in Erp.Contracts.BO.Labor.dll

Ok so it was a 2 part puzzle, and Jose solved both pieces:

First, the exception was caused because I did not have any data in the LaborAdapters.LaborData (I had loaded it into a dataset). To solve, I used the LaborAdapter.GetById(LaborHedSeq)

Also, once data was populated in LaborAdapter.LaborData I had to set it as modified:
LaborAdapter.LaborData.LaborHed[0].RowMod=“U”;

You have to do this before calling: Labor.GetNewLaborDtlOnSelectForWork()

//And finally these - Especially UPDATE!
adapterLabor.SelectForWork();
adapterLabor.CheckWarnings(out pcMsg);
adapterLabor.CheckFirstArticleWarning(out pcMsg);
adapterLabor.Update();

Thanks Jose - You ready to give up that paypal email yet so I can start buying you beers?

2 Likes