Force synchronization in Microsoft Dynamics AX 2012 using X++
Dictionary dictionary; int iLoop; int totalTablesCount; TableId tableId; Application application; SysOperationProgress progress; StackBase errorStackBase; ErrorTxt error; ; application = new Application(); dictionary = new Dictionary(); totalTablesCount = dictionary.tableCnt(); progress = new SysOperationProgress(); progress.setTotal(totalTablesCount); progress.setCaption("@SYS90206"); errorStackBase = new StackBase(Types::String); try { for (iLoop = 1; iLoop <= totalTablesCount; iLoop++) { tableId = dictionary.tableCnt2Id(iLoop); progress.setText(dictionary.tableName(tableId)); application.dbSynchronize(tableId, false, true, false); progress.incCount(); } }