Problem statement:

With one of the customers of Microsoft Dynamics AX 4.0, we have planned to data upgrade of their Production AX instance to Microsoft Dynamics AX 2012 R2 in two phases which means that data upgrade will be done during 2 consecutive weekends so it means that AX 4.0 will be live for production during the weekdays. So in the first phase, we have run the Microsoft Upgrade scripts on source system i.e. AX 4.0 and upgrade has successfully fill the shadow tables. Now, when we run the AX 4.0, we encounter the issue that InventTrans is fail to create / edit in the most of the documents. Error is something like below:

“Cannot edit a record in Inventory transactions (InventTrans). Reference: Sales order, 000012009. The SQL database has issued an error.”



After debugging the hours, in the event viewer of AOS machine we found the sql statement which is failing to insert / update. We copy that sql statement and make it proper sql and run it on SQL server management studio. Here we get the correct error message which is causing issue to not allow to insert / update InventTrans record. I didn’t remember the exact error message but it something like that “a procedure AXUpgrade_177 has error in line 30… lose of data conversion ”

After debugging this new error 🙂 we found that during the upgrade scripts which run on AX 4.0, it created a trigger AXUpgrade_177 on InventTrans table. Trigger is basically inserted the record in the CheckTrack_InventTrans table to maintain the records for delta processing which we have planned to do it in second phase. We found that there is an insert-select statement written in the trigger and in that statement a field TransRefId of CheckTrack_InventTrans table is mapped with the TransRefId of InventTrans. When we checked these tables from AOT we found that EDT is missing in the TransRefId of CheckTrack_InventTrans and is of 10 length whereas TransRefId of InventTrans is of 20 length and it has extended from InventTransRefId EDT. So we have updated the EDT of TransRefId of CheckTrack_InventTrans to InventTransRefId 🙂


Leave a Reply

Recent Comments