I am trying to add OrderComments to the Fulfillment workbench Order Fulfillment tab. We are running 10.2.500.40. I found this article Add UD fields from other BO in grid - #15 by A.Baeisa It gave me a few ideas but they do not seem to be working.
I think you want to swap ttOrderAllocList and OrderAllocRelease in your foreach statement. Then where you reference ttOrderAllocList inside of the foreach, swap that with OrderAllocRelease.
Then remove the .OrderComment from the end of dbOrderHeadOrderComment. Like this:
foreach (var OrderAllocRelease in (from row in ttOrderAllocList select row))
{
var dbOrderHeadOrderComment = (from row in Db.OrderHed
where row.Company == Session.CompanyID &&
row.OrderNum == OrderAllocRelease.OrderNum
select row.OrderComment).FirstOrDefault();
if (dbOrderHeadOrderComment != null)
{
OrderAllocRelease.WarehouseCode = dbOrderHeadOrderComment;
}
else
{
OrderAllocRelease.WarehouseCode = "";
}
}
Only if you have to use that in another widget within that BPM. Otherwise, you have already instantiated the OrderAllocRelease variable within the custom code which should be an OrderAllocListTable or whatever type it is.