We are looking to set ProductionYield on all jobs that got batched except for the batch job. I hope I am close to the solution. I have created a BPM for Job Entry.Update instead of SchedulingBoard.BuildJobLine. I was getting an error saying ‘SchedulingBoardTableset’ does not contain a definition for ‘JobHead’ and no accessible extension method ‘JobHead’ accepting a first argument of type ‘SchedulingBoardTableset’ could be found (are you missing a using directive or an assembly reference?)
Below is the code I have, and it compiles with no errors. It doesn’t seem to do anything; that is why I am wondering if I have it tied to the wrong method directives. Or should I use this in a function instead and call it from an event in Application Studio? Any help would be greatly appreciated. I am willing to bet we are not the first company to try this.
THIS IS A TEMPORARY FIX. We are developing a massive customization to streamline the whole batching process, but it will not be ready for go-live before the end of the month. So if you have a solution held together with duct tape, that sounds perfect!
var ttRow = ds.JobHead.FirstOrDefault();
var ttRow2 = ds.JobProd.FirstOrDefault();
if(ttRow != null)
{
string jobNum = ttRow.JobNum;
var jobSvc = Ice.Assemblies.ServiceRenderer.GetService<JobEntrySvcContract>(Db);
var jobDS = jobSvc.GetByID(ttRow.JobNum);
bool ProdYield = ttRow.ProductionYield;
string TargetJobNum = ttRow2.TargetJobNum;
if (ProdYield == true)
{
if (TargetJobNum != string.Empty)
{
ttRow.JobNum = ttRow2.TargetJobNum;
ttRow.ProductionYield = false;
jobSvc.Update(ref jobDS);
}
}
}