Cannot create a record in Dimension history for documents (InventReportDimHistory). Error on Vendor invoice posting.

Usually we can get this error for non PO vendor invoice.

To fix it you need to change one of these two number sequences:

  • Internal invoice
  • Internal credit note


Because if they have identical structure they will generate  same numbers and that’s the real cause of this error.

Now let’s look what is happening under the hood.

Unique index of InventReportDimHistory consists of four fields:

  • TransRefId
  • InventTransId
  • TransactionLogType
  • InventDimId

InventTransId is always blank, because non PO invoice lines could have only non-stocked items or procurement categories.

InventDimId could be identical for multiple lines, for example “AllBlank” or any site and warehouse combination.

TransactionLogType is a document type. For invoice it is “PurchInvoice”, for packing slip –  “PurchPackingSlip” and so on.

The last field is TransRefId which is based on InternalInvoiceId field from the Invoice Journal.

InternalInvoiceId is number sequence generated, so it should be unique for each posted invoice.  However, AX could use two different number sequences for this field.

First one is used for invoices and second for credit notes and if this two number sequence have same structure, for example usmf-#######, you could hit this issue when you will create credit note, because at some point AX could generate number for credit note that was already used for invoice.

Please note that other number sequences can be used for some localisations like RU or MY. To get list of all possible number sequence you can look at PurchInvoiceJournalCreate.allocateNumAndVoucher() method.


One thought on “Cannot create a record in Dimension history for documents (InventReportDimHistory). Error on Vendor invoice posting.

  1. Palle Agermark September 5, 2019 / 10:50 am

    Three years later, this post saves my day. Thanks!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s