Wednesday, October 10, 2018

AX 2012 - Change tracking may cause Db or Specific table synchronization issues

Change tracking on specific table(s) or whole database, may fail sync when run through AX 2012. A sample error is given below when surprisingly the field length shown in Table was smaller than what was shown in AX client.

The object 'I_158INVENTLOCATIONIDX' is dependent on column 'InventLocationID '. ALTER TABLE dbo.InventLocation ALTER COLUMN InventLocationID VARCHAR(20) NOT NULL; failed because one or more objects access this column.

OR 

Msg 5074, Level 16, State 1, Line 1
The object 'DF__INVENTLOC__INVEN__3F7D091C' is dependent on column 'InventLocationID'.
Msg 5074, Level 16, State 1, Line 1
The object 'I_158INVENTLOCATIONIDX' is dependent on column 'InventLocationID'.
Msg 4922, Level 16, State 9, Line 1

ALTER TABLE ALTER COLUMN InventLocationID failed because one or more objects access this column.


Disabling the table change tracking from SQL Server, and then running sync from AX would synchronize successfully and correct the field length size issues as well.