Initially the sync problem that I was having was in relation to running the process in a PowerShell automatically, however, I realized that this may be only one of the scenarios ...
So, the scenario is like this:
you have an AX 2012 instance with your model installed and the database filled with data;
you delete your model and want to install a newer version that has other IDs for the table;
you want to keep the data and the sync errors out.
I am not sure if this solution will resolve all your problems or maybe you can find another approach to fix your issue, but this works fine for my tasks: http://axsyncautofix.codeplex.com/
The class will basically go through all the tables and do the following for each one:
- move to a temp id the different table that holds this id;
- see if you already have the AOT table in the SQLDictionary and if you do change the id if it is different (for the table and all it's fields);
- then parse through all the fields in your layer's id interval and perform the same logic:
- move to a temp id the different field that holds this id;
- change the id if it is different.