Converting ABL Code to C# Errors

HI,
I used to have a BPM that made sure material was issued when an operator ends activity. I used the ABL to C converter from Epicor. I’n not good at C yet. I am trying to get it working but keep getting the error that ttLaborDtl_xRow doesn’t exist. I’ve tried in both the Labor.Update, Labor.EndActivity methods. I would also like to only check parts with the class of CORE.

Erp.Tables.JobMtl JobMtl;
foreach (var ttLaborDtl_iterator in (from ttLaborDtl_Row in ttLaborDtl
where string.Equals(ttLaborDtl_Row.RowMod, IceRow.ROWSTATE_UPDATED, StringComparison.OrdinalIgnoreCase) && string.Compare(ttLaborDtl_Row.LaborType, “P”, true) == 0
select ttLaborDtl_Row))
{
var ttLaborDtlRow = ttLaborDtl_iterator;
foreach (var JobMtl_iterator in (from JobMtl_Row in Db.JobMtl
where string.Compare(JobMtl_Row.Company, ttLaborDtl_xRow.Company, true) == 0 && string.Compare(JobMtl_Row.JobNum, ttLaborDtl_xRow.JobNum, true) == 0 && JobMtl_Row.AssemblySeq == ttLaborDtl_xRow.AssemblySeq &&
JobMtl_Row.RelatedOperation == ttLaborDtl_xRow.OprSeq
select JobMtl_Row))
{
JobMtl = JobMtl_iterator;
if (JobMtl.IssuedQty > 0)
{
continue;
}
if (JobMtl.IssuedQty == 0)
{
CallContext.Current.ExceptionManager.AddBLException(“Material " + JobMtl.PartNum + " not issued.”);
ttLaborDtl_xRow.LaborQty = 0;
}
}
}

you should use one of these defined variables, not ttLaborDtl_xRow as you did not declare it at all.

1 Like