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)

Set or Change InvoiceId

(0) ShareShare
ReportReport
Posted on by

Hello everyone,

My team and I are currently working on a project where we are onboarding several new locations into our Dynamics AX 2012 R2 environment.

We would like to historically add sales orders / invoices into AX to represent sales orders / invoices from legacy systems used by these new locations.

With that being said, I have exposed some X++ code via an AIF inbound port to dynamically create sales orders, sales lines, and post the sales order to create an invoice.

However, we would like to use the original invoice number from the legacy system once the invoice has been 'recreated' in Dynamics AX.

Can anyone think of a way to either:

1. Set the invoice number to be used before invoicing the sales order so it uses that number

2. Reliably Update all of the related records after the fact such as InvoiceId on CustInvoiceJour, CustInvoiceTrans, Invoice on CustTrans ... etc?

Any and all help on this would be greatly appreciated.

Thank you,

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Ludwig Reinhard Profile Picture
    Microsoft Employee on at

    Hi,

    Why don't you write the old invoice number into a new field or even an existing one such as the customer reference field? To me this seems safer and easier than trying to change or modify the AX invoice number.

    Best regards

    Ludwig

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
CP04-islander Profile Picture

CP04-islander 39

#2
Michel ROY Profile Picture

Michel ROY 14

#3
imran ul haq Profile Picture

imran ul haq 8

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans