When converting quote to SO with multiple line items the rep groups are not mapping correctly from the quote on subsequent lines. Line 1/release 1 maps as expected but subsequent lines only mapped the ship to rep group (QuoteHed.Character10).
Make a test code block and try this code, I don’t think you need the first reference to the OrderHed table unless you need to set something on that too??
var OrderDtls = (from OD_row in Db.OrderDtl where OD_row.Company == Session.Company && OD_row.OrderNum == orderNum select OD_row).ToList();
if (OrderDtls != null)
{
foreach(var OrderDtl in OrderDtls)
{
var OrderRel = (from OR_row in Db.OrderRel where OR_row.Company == Session.CompanyID && OR_row.OrderNum == orderNum select OR_row).FirstOrDefault();
if (OrderRel != null)
{
var QuoteHed = (from qh_row in Db.QuoteHed where qh_row.Company == Session.Company && qh_row.QuoteNum == OrderDtl.QuoteNum select qh_row).FirstOrDefault();
if (QuoteHed != null)
{
OrderRel.Character02 = QuoteHed.Character12;
OrderRel.Character10= QuoteHed.Character13;
OrderRel.Character01 = QuoteHed.Character10;
}
}
}
Db.Validate(); //I don't think you need this line
}
I am thinking the issue is coming somewhere from the bpm might only be looking and applying the changes to the first row/line one and any subsequent lines/rows are not being ran through the method?