This is the third and last part of the code upgrade series. In the last part, we covered the use of code upgrade tool to migrate AX2012 code to Dynamics 365 environment. In this part, we will see how the code conflicts can be resolved. Please note that code conflicts only need to resolve if you are going for overlayering approach. If you are going for extension approach, the conflicted code will be moved to extensions. We have seen that the overlayered code now resides in various new models that were created during the process and are part of the base models (Application Platform, Application Suite, etc.).
Now let’s go ahead and open CodeMergeSolution in visual studio. This solution has elements with conflicts and we will first resolve these. You will find [!] with elements, that represent the conflict and [c] represent that the element is customized.
First, we will see how we can resolve the conflicts in classes. Open the class in designer view, and right click on it and select ‘Resolve code conflicts’.
Code comparison window will now open. Here we will merge our code with the actual baseline code. Once done, click ‘Accept Merge’.
Now let’s move over to EDT and Enums conflict resolution. For EDT and Enum, there will be only property conflicts, so we will resolve those by selecting ‘Resolve property conflicts’ option.
Select the appropriate value and click OK.
For tables and forms, I prefer to use Compare tool to find the conflict. Particularly for tables, visual studio shows code conflicts under conflict node when you open the table in designer view. But if there are other conflicts (for e.g. a conflict in a property value for any table node), compare tool will help you in that regard.
When migrating from AX2012 to D365, delete actions are normally defined on tables, since in D365, display action are now defined on table relations, it is treated as a conflict, and to find this type of conflict, compare tool will be useful.
Again, if you are using extension approach, this part of the series won’t help you as you will have to manually transfer your conflicted code to extensions. Now the question is, if you are going for extension approach, how you will start? One of my colleague has recently published a blog that will help you. Below is the link.