Updating Inventory transactions reference Id


-Dynamics AX 2009-

This case start to cause me a headache, any help please,

We have a huge number of transaction for the Item “10002” which missing the inventory transaction reference Id (InventTrans.inventRefTransId) I want to create a job to update these transactions with the reference Id.

I know that the reference Id comes from “Sales orders” or “Purchase orders” based on the transaction type, but how could I find the specific sales order or purchase order for every transaction to update it?

Any help please :slight_smile:


I believe that InventRefTransId is filled in for marked inventory transactions, not for all transactions.

Furthermore, you don’t need any link from inventory transactions back to orders. Both SalesLine and PurchLine tables contain InventTransId; it’s even their primary key!

Hi Martin, I’m really very thankful for your replies :slight_smile:

I have around 12000+ transactions for this item that are missing the InventTransRefId in VendTrans table, when I try to do transactions closer these transactions stays open! So I’m trying to close + settle them by using a job.

What I understood from you that’s it’s ok to close them without filling InventTransRefId? or I miss understood?


Your original question is about InventTrans.inventRefTransId and now you switched to VendTrans.InventTransRef. Which one is correct? By the way, I do not believe that standard AX contains VendTrans.InventTransRef.

If you want to fill InventTrans.InventRefTransId, you have to know which two inventory transactions your want to link. There are some classes to do it correctly. Nevertheless I’m not sure that you really understand the purpose of that field.

Sorry Martin, my bad I wrote by wrong “VendTrans” I meant “InventTrans”. - didn’t sleep from 3 days-

I know that this fields links between the inventory transaction and the original transaction (sales order line, purchase order line,…etc).

Thanks for the help, I will look for these classes.

Regards, :slight_smile:

InventRefTransId refers to InventTransId of another inventory transaction (although it true, as I already said, that InventTransId is also used as primary key of order lines). Please read Description of the Marking functionality that is used in inventory transactions in Microsoft Dynamics AX to understand the related business logic.

Thanks a lot this is very helpful.