Since you are not using the BO and you are using the LINQ Method to directly update ReqDate, you are missing out of Epicor calling “AfterUpdate” which syncs PartDtl. I didnt mean like really change it but trigger a Fake Change.
May I make a better recommendation.
I am actually doing a similar project like you, but I placed my Logic inside:
Erp.DemandImportEntry.ImportEDIPostProcessDemand
This would happen after the Order Lines and Releases have been created, either from Demand WkBench or EDI Import Process. I do stuff on the Line you can do stuff on OrderRel.
var DemandHeadRow =
(from row in Db.DemandHead.With(LockHint.NoLock)
where
row.SysRowID == DemandHeadRowid
&& row.EDIOrder == true
&& row.PONum.StartsWith("SO-")
&& row.POType == string.Empty
select row
).FirstOrDefault();
if (DemandHeadRow != null)
{
var DemandDetailRows =
(from dd in Db.DemandDetail.With(LockHint.NoLock)
where
dd.Company == DemandHeadRow.Company
&& dd.DemandContractNum == DemandHeadRow.DemandContractNum
&& dd.DemandHeadSeq == DemandHeadRow.DemandHeadSeq
&& dd.Posted == true
&& dd.RejectedByUser == false
&& dd.OrderNum != 0
&& dd.POType == string.Empty
select dd
).ToList();
foreach (var demandRow in DemandDetailRows)
{
var OrderDtlRow =
(from od in Db.OrderDtl
where
od.Company == demandRow.Company
&& od.OrderNum == demandRow.OrderNum
&& od.OrderLine == demandRow.OrderLine
select od
).FirstOrDefault();
if (OrderDtlRow != null)
{
using (var txScope = IceContext.CreateDefaultTransactionScope())
{
OrderDtlRow.CustomerOwnedInventory_c = true;
Db.Validate(OrderDtlRow);
txScope.Complete();
}
}
}
}
The method directives used in Import EDI Demand processing are as follows:
- ImportEDIb4tran - If it exists, the Import EDI Demand Process runs the custom BPM code you associate with this method directive to manipulate inbound EDI data stored in Intermediate Demand tables before the ImportEDI routine runs and processes translations on the data.
- ImportEDIb4val - If it exists, the Import EDI Demand Process runs the custom BPM code you associate with this method directive to manipulate translated inbound EDI data stored in Intermediate Demand tables before the ImportEDI routine runs and performs validations on the data.
- ImportEDIpreProcessDemand - If it exists, the Import EDI Demand Process runs the custom BPM code you associate with this method directive to manipulate validated inbound EDI data stored in the regular Demand tables before the ImportEDI routine processes the demand data into actual sales orders or forecasts.
- ImportEDIpostProcessDemand - If it exists, the Import EDI Demand Process runs the custom BPM code you associate with this method directive to manipulate inbound EDI data after the ImportEDI routine processes the demand data into actual sales orders or forecasts.
- ImportEDIonUDImport - If it exists, the Import EDI Demand Process runs the custom BPM code you associate with this method directive when more than 95 User Defined (UD) fields exist on an inbound EDI transaction map you are importing. The ImportEDIonUDImport method directive is only available in Release 10.1.400.12 and above.