web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Error while posting invoice

(0) ShareShare
ReportReport
Posted on by 6,494

Hi,

I got following error while posting Free text invoice

"cannot insert multiple records in accounting distributions (accountingdistribution), record already exists"

Do I have to check some setups?

*This post is locked for comments

  • André Arnaud de Calavon Profile Picture
    307,786 Super User 2026 Season 2 on at

    Hi Joni,

    Is this a clean environment or was it used before and transactions were deleted to start over again?

    This is not related to setup.

  • Johnny Profile Picture
    6,494 on at

    Hi Andre,

    I just restored the DB with changes of previous week.

    in accountingdistribution table I see more then Million records

  • André Arnaud de Calavon Profile Picture
    307,786 Super User 2026 Season 2 on at

    Hi Joni,

    This could be caused by the database restore. Probably some records are missing or there are some records already present which are created during posting again. You can e.g. use the debugger to find that place. Or find the related records in the AccountingDistribution table using the SourceDocumentLine fields on this and the free text invoice line table.

  • Johnny Profile Picture
    6,494 on at

    Hi,

    The error comes from classes\SourceDocumentStateInProcess\persistAccountingDistributionInsertList() method. Line: distributionInsertList.insertDatabase();

    where distributionInsertList is RecordInsertList class.

    Can you advice some additional way?

  • Prashant Singh Profile Picture
    8,802 on at

    Dear Joni,

    Your query is not clear.Kindly provide the screen shot to make it more clear so that I can help you in this.

  • Johnny Profile Picture
    6,494 on at

    Hi Prashant,

    I'm trying to post "Free text invoice" and I'm getting the error: "cannot insert multiple records in accounting distributions (accountingdistribution), record already exists"

    Because I could go directly on the line from info, I added breakpoint to add method of info class and found out that error comes from below method

    private void persistAccountingDistributionInsertList()
    {
        if (initializedDistributionInsertList)
        {
            distributionInsertList.insertDatabase();
            accountingDistributionSystemSequence.removeRecIdSuspension(tableNum(AccountingDistribution));
        }
    }


  • André Arnaud de Calavon Profile Picture
    307,786 Super User 2026 Season 2 on at

    Hi Joni,

    If you use the AX debugger, you can set a breakpoint on this method. Then you can see which other method is calling this one and all related variables to investigate further.

  • Sohaib Cheema Profile Picture
    49,668 Super User 2026 Season 2 on at

    it will be good if you start debugging from CustPostInvoice (Class) and reach till SourceDocument, so you will come to know exact location of issue.

  • Suggested answer
    Aijaz Profile Picture
    on at

    Hi Joni,

    Following link might be help you

    sashanazarov.blogspot.com/.../bug-in-source-document-framework-ax.html

    Regards,

  • APG02 Profile Picture
    on at

    Hi,

    We also faced similar issue in AX2012 R2. We reset the accounting distribution on Free text invoice line after which system allowed us to post the document. Here to be noted that the distribution needs to be reset for every line.

    Thanks

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the August Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans