Update conflict error thrown when an Intercompany Purchase Order is invoiced

ISSUE: When an Intercompany Purchase Order is invoiced, “Cannot edit a record in Purchase order lines (PurchLine). An update conflict occurred due to another user process deleting the record or changing one or more fields in the record.” error thrown.

 

RECOMMENDATION: In \DataDictionary\Tables\CustInvoiceJour\Methods\interCompanyUpdate, reread method should be called first to make sure that PurchLine table buffer uses its latest versionId

 while select forupdate purchLine

where purchLine.PurchId == interCompanyPurchId

&& !purchLine.IsDeleted

{

purchLine.reread();

if
(inventTransIdMap.exists(purchLine.InventTransId))

{

purchLine.PurchReceivedNow =
inventTransIdMap.lookup(purchLine.InventTransId);

}

 

Similar function used in \Classes\SysCodeProfilerCleanUp\delete.