Version Control in Dynamics AX: Ensure that code changes are being made in model tied to version control

by | Updated April 11, 2017 | Development, Dynamics AX

Recently we ran into an issue where code changes were made in a model that was not tied to version control. When it came time to create a new build these changes weren’t included when the version control sync was executed. We had to take the time to move all of this code from one model to another and restart the build process. After this situation occurred a couple of times I decided to try to find a solution to help prevent this.

What I did was make a change to the class SysVersionControlSystem. This addition takes the version control folders from the XML definition file and compares them to the current model when AX is opened. If the current model doesn’t match a folder tied to version control it will return an error stating to change the model before making code changes. If this message does come up it is best to change the startup model in Tools – Options in the development tab. This is a pretty simple solution but could end up saving a lot of time if code changes are ever made in the incorrect model. It will also catch if a developer opens AX in a layer that is not tied to version control. Code screen shots are below.

NOTE: This was tested using Team Foundation Server. I did not test with Source depot or Visual SourceSafe but think it should work with them. I don’t think this would work with MorphX VCS since it uses AX database tables and doesn’t have a local repository folder.

Code review:
Created new method called ssi_ValidateCurrentModel. In method createModelsMap added call to new method (shown in first screenshot at end of method)


Related Posts


Submit a Comment

Your email address will not be published. Required fields are marked *

Upcoming Events


12aug10:00 am10:30 amWhy Levridge Grain? How to Achieve Efficient and Accurate Scale Tickets

12aug12:00 pm1:00 pmThe Three Paths to Dynamics 365 Finance and Supply Chain from Dynamics AX

13aug11:00 am12:00 pmConfab with Stoneridge - Livestream - Inspire Keynote Breakdown

19aug10:00 am11:00 amWhat is Levridge? An Overview of the Ultimate Ag Solution

19aug12:00 pm12:30 pmThe Modern Manufacturer - Death by Safety Stock

27aug11:00 am12:00 pmConfab with Stoneridge - Livestream - Dynamics 365 2020 Wave 2 Preview


02sep10:00 am10:30 amThe Modern Manufacturer - Cycle Count Management

09sep10:00 am11:00 amWhat is Levridge? An Overview of the Ultimate Ag Solution

16sep10:00 am10:30 amThe Modern Manufacturer - Product Lifecycle Management

30sep10:00 am10:30 amThe Modern Manufacturer - Return Management

About Stoneridge
Stoneridge Software is a unique Microsoft Gold Partner, with emphasis on partner. With specialties in Microsoft Dynamics 365, Microsoft Dynamics AX, Microsoft Dynamics NAV, Microsoft Dynamics GP and Microsoft Dynamics CRM, we focus on attracting the most knowledgeable experts in the field to our team, and prioritize delivering stellar solutions with maximum impact for your business. At Stoneridge, we are deeply committed to your results. Each engagement is met with a dedicated team, ready to provide thorough, tailored, and expert service. Based in Minnesota, we intentionally “step into your shoes,” wherever you are. We focus on what you care about, and develop trusting, long-term relationships with our clients.

Subscribe To Our Blog

Sign up to get periodic updates on the latest posts.

Thank you for subscribing!