Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX forum
Unanswered

SourceDocumentHeader and SourceDocumentLine update failure with converted Purchase Orders

Posted on by 800

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

Categories:
  • Rafael Ruiz J Profile Picture
    Rafael Ruiz J 10 on at
    RE: SourceDocumentHeader and SourceDocumentLine update failure with converted Purchase Orders

    Recently I had the same issue. I followed the usual path for this message, but generated from SOP module (Delete records from SY00500 where the BACHNUMB = USER). In this case I haven't a BACHNUMB with the name of the user, but I found a Batchnumb called RMPMXFR +User and in the field USERID there was the name of the user. There was 2 records, one for PM series and one for RM series.


    SELECT * FROM SY00500 WHERE USERID='BLOCKEDUSERNAME' 

    *Change BLOCKEDUSERNAME for the name of the user.

    I made sure there were no transactions in work in PM and RM assigned to those BACHNUMB's and in addition that the NUMOFTRX field is zero in the SY00500 and I removed the 2 records.

    This allowed me to open the window again.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: SourceDocumentHeader and SourceDocumentLine update failure with converted Purchase Orders

    Hi Konrad,

    Could you explain what the minor code fix was in your case?

    I'm having the same issue on a D365 enviroment but with a purchase order I create manually. 

    Thanks,

    Ciprian

  • Konrad U Profile Picture
    Konrad U 800 on at
    RE: SourceDocumentHeader and SourceDocumentLine update failure with converted Purchase Orders

    Update: This was one of those problems that ultimately was resolved by a minor code mod allowing the error to be bypassed since it was only on converted orders via DIXF.

  • AhmedMgamal Profile Picture
    AhmedMgamal 75 on at
    RE: SourceDocumentHeader and SourceDocumentLine update failure with converted Purchase Orders

    Is the purchase order generated from purchase requisition, if yes check source document line table for the pr line the status should be completed,

    If your issue is regenerated and have a repro steps try to remove your customization and check again

Helpful resources

Quick Links

Replay now available! Dynamics 365 Community Call (CRM Edition)

Catch up on the first D365 Community Call held on 7/10

Community Spotlight of the Month

Kudos to Saurav Dhyani!

Congratulations to the June Top 10 community leaders!

These stars go above and beyond . . .

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 288,420 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 225,672 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans