I hope someone has seen this before and has found a solution. New purchase orders do not generate the cannot update SalesDocumentLine record but some of the converted ones do. We get the unable to update SourceDocumentLine followed by the update canceled messages. This is during confirmation or just viewing the distribution.
The SalesDocumentHeader and SalesDocumentLine references in the PurchTable and PurchLine appear valid. Each purchase table order with one line has a source document header record and a source document line record. The purchase line record has a source document line record as well. Deleting and reading the line does not fix the problem so it may be header based.
For some reason the source document line record keeps trying to add an AccountingDistribution record even though the correct line distribution record is already there.
The failure is in SourceDocumentLineState\updateReferenceData on the line:
sourceDocumentLine.update();
I have found other instances of the problem on the web but no definitive solution with the suggestion to try and regen the CIL.
Any suggestions would be helpful. At the point of the failure the SourceDocument classes are 11 deep so diagnosis is real difficult.
Thanks!
Konrad
*This post is locked for comments