I am new to C# and Epicor coding, and trying to write code to print x number of labels depending on a UD field on the PartPlant record. (PrintMethod_c)
I have my foreach loop set up to iterate through ttRcvDtl and it is dutifully spitting out the print method, but it’s doing it twice for each line. I remember reading that tt tables contain double rows (before and after changes) but cannot find the thread or one that gives a quick way to get around that.
To put it simply, what’s the best way to get 3 results for a 3 line receipt instead of 6?
Erp.Tables.PartPlant PartPlant;
foreach(var row in ttRcvDtl)
{
string resultPart = row.PartNum;
// Get PartPlant record for current ttRcvDtl row
PartPlant = (from partpRow in Db.PartPlant where partpRow.Plant == callContextClient.CurrentPlant && partpRow.Company == callContextClient.CurrentCompany && partpRow.PartNum == resultPart select partpRow).FirstOrDefault();
// Get Print Method
string PrintMethod = PartPlant.UDField<System.String>("PrintMethod_c");
// Debug MessageBox
this.PublishInfoMessage(PartPlant.PartNum + " : " + PrintMethod, Ice.Common.BusinessObjectMessageType.Information, Ice.Bpm.InfoMessageDisplayMode.Individual, "", "");
}