The below BPM code, was originally converted by Epicor when we upgraded from 9.05 to Epicor 10. It ran perfectly fine, up until recently (not exactly sure when it stopped running correctly). The BPM used to display a message when a checkbox in Part Maintenance was checked for each J
obAsmbl during the GetDetails action in Job Entry. It now only displays the message if the JobAsmbl is the Top level part or the first sub-assembly level, picture included for example (red border doesn’t display message). The BPM originally was set to Post Process on the Erp.BO.JobEntry.GetDetails but it didn’t run at all there anymore, so I moved it to Erp.BO.JobEntry.GetDetailsMsgWarning after running a Tracelog. Any assistance with getting this to drill through all the sub-assemblies again will be greatly appreciated.
foreach(var Rs_JobAsm in(from row in result.JobAsmbl select row))
{
foreach(var Rs_Part in(from row in Db.Part.With(LockHint.NoLock) where row.Company == CompanyID && row.PartNum == Rs_JobAsm.PartNum && row.CheckBox17== true select row))
{
this.PublishInfoMessage("INSPECTION PAPERWORK IS REQUIRED FOR PN:" + Rs_Part.PartNum.ToString(),Ice.Common.BusinessObjectMessageType.Information, Ice.Bpm.InfoMessageDisplayMode.Individual,"","");
}
}
@CFadmin Welcome. I would assume that the dataset is only holding updated JobAsmbl records now as the product has progressed. If you look back at the Db you can get all of the assemblies. I did a couple of changes to bring only back the data needed and only do one message for all assemblies that needed paperwork.
/* Check Part for SB17 = true */
string InfoMsg = string.Empty;
var partList = (from jaRow in Db.JobAsmbl
join p in Db.Part.With(LockHint.NoLock)
on new {jaRow.Company, jaRow.PartNum} equals new {p.Company, p.PartNum}
where jaRow.Company == Session.CompanyID && jaRow.JobNum == currJobNum && jaRow.PartNum == p.PartNum && p.CheckBox14 == true
select new {p.PartNum, p.CheckBox17}
).ToList();
foreach (var partRow in partList.Where( p => p.CheckBox17 == true))
{
InfoMsg = InfoMsg + $"INSPECTION PAPERWORK IS REQUIRED FOR PN: {partRow.PartNum}\n";
}
if (InfoMsg != string.Empty)
{
this.PublishInfoMessage(InfoMsg,Ice.Common.BusinessObjectMessageType.Information, Ice.Bpm.InfoMessageDisplayMode.Individual,"","");
}
Thank you so very much. Is it possible though to have the below line only show up once at the top and just have all the part nums listed below? If not, I’ll make do
InfoMsg = InfoMsg + $"INSPECTION PAPERWORK IS REQUIRED FOR PN: {partRow.PartNum}\n";