The BAQ call via BPM failed, so I’m now attempting to code it directly in the BPM; that is, to concatenate all the manufacturers into a single column for each part number, then push that into a UD field on the SugPoDtl table when we generate new PO Suggestions.
So here’s the BPM, an In-Transaction Data Directive on the SugPoDtl table:
I regenerated new suggestions several times yesterday, and each time it got hung up and required manually deleting the task from the System Monitor (this is in our Test Environment where it usually takes about 20 minutes). The code editor gave me an OK when I checked the syntax, there are no validation issues, but not even the message boxes popped up while generating suggestions. Where am I going wrong here? Incorrect code, incorrect BPM, etc? Any help is welcome, thanks!
var nameTable = (from p in Db.Part
join ap in Db.AprvMfg on p.PartNum equals ap.PartNum
join m in Db.Manufacturer on ap.MfgNum equals m.MfgNum
group m by p into g
select new { PartNum = g.Key, Names = string.Join(",", g.Select(y => y.Name)) }).ToList();
foreach(var SugPoDtl in ttSugPoDtl)
{
foreach(var t in(from t in nameTable where t.PartNum.ToString() == SugPoDtl.PartNum.ToString() select t))
{
SugPoDtl.AprvMfg_c = t.Names;
}
}