TFS Code Repository and Dynamics AX

by | Updated August 15, 2016 | Development, Dynamics AX

If you are using TFS as your Dynamics AX code repository, there are a few things you will want to do to make life easier for those around you.

Dynamics AX & TFS Integration

First, here is where you would go to setup your TFS integration in Dynamics AX 2012:

David B_Version Control

This will open this form:

David B_Form

Make sure to open both pages as well:

David B_Well

This page is actually more important than the first. You can see that here is where we will be setting up the connections to Dynamics AX. Work with your TFS admin to get the values for these.

Adding Code & Checking out Code

In order to add Dynamics AX code to your TFS repository, you must first make a change to bring the code into your current layer. So make your needed changes, then you can right-click on the object and choose “Add to Version Control.”

David B_AOT

To check out code you can either right-click on the object in the AOT and choose “Check out.”

David B_Check out

Or, there is a button on the toolbar if you are in the editor.

David B_Editor


A bit separate from this is labels.

David B_Labels

If you go to the label editor you will be presented with a few buttons across the top. When you need to create a new label, I recommend you do “Get latest” first. In theory, the system should do that during checkout, but I feel it is better to be safe and do it yourself.

David B_Yourself

The other thing to mention with labels is that if you have single checkout enabled (only one person can check out an item at a time) you need to comment out the following code.

David B_Code

Checking in Code

Once you are ready to check in, go to Version Control > Pending Objects. This will show you a list of everything that is ready to be checked in. You will notice that there is a “Check In” button here as well.

David B_Check in

You can also check in by right-clicking an object in your AOT and clicking “Check In”:

David B_Check in 2

Or, with the button on the editor:

David B_Editor 2

Once you click on the button a new dialog will show up.

David B_Show Up

Here, you can select what objects you want to check into TFS. You will also see a text box on the top of the tab page. Here is where you would put the description of your check in. I highly recommend a standard format to be used by all of the developers on your team. The format I use is:

<Initials> – FDD <###> (or) Bug <###> – <Description>

You should notice that there is a second tab page as well. Here you will choose what task to associate this check-in with. In general, it is best to associate a check-in with a TFS task. The list that you see is anything that you are assigned to in TFS. If you need to check in against a task that is not assigned to you, there is an “Add task” section on the top that will allow you to put in a TFS ID so you can check in against it.

David B_Checkin against it

Once your code is checked in, you can now go into Visual Studio and see the object.

David B_Object

From here you can view the history of the object and many other cool features.

Synchronizing Your Code

The other thing you want to make sure you do frequently is Synchronize your code in AX with what is in the TFS code repository. To do this simply click on Version Control > Synchronize.

David B_Synchronize

This will present you with a new window.

David B_Window

Simply click the “OK” button and it will pull in the latest version of the code into AX. You will notice that there is also a “Force” check box. Checking that check box tells AX to pull in EVERYTHING from source control. In general, you don’t need to do “Force” very often. The non-Force “incremental” synchronize is usually sufficient. My practice is to run this once a week (usually Monday) or if I know a large feature has been checked in that I want to pull down locally. How often you synchronize is really up to you.

If you do not want to pull everything down, you can sync one item at a time by going to the object in the AOT, right-clicking on it, and selecting “Get Latest.”

Davic B_Get Latest

Synchronization Log

The last thing to bring up is the “Synchronization log.” You can find it right under the Synchronize menu option. Version Control > Synchronization log. For the most part, you don’t need to worry about this form, but you may get an error when trying to sync down an object saying something to the effect of “This object was not imported properly, please check the synchronization log and try again.” The easiest way to fix this is to open the log and click the “Clean all” button. This will clear out the log and allow you to attempt to pull the object down again.

Synchronization log in TFS code repository


For more information on TFS queries for the Dynamics AX Developer check out my previous blog.

Happy coding!

Related Posts


  1. Anderson

    Hi .
    I have been using Dynamicx AX 2009 with TFS for some time, and i have two questions..
    1: What can i do to get all objects in a project (XPO) from TFS at once?
    2: I have a process when production ackup is resotored on DEV environment (in order to mantain DEV environment refreshed) but im looking form some way to tell the AX to upload the code to the TFS, so the TFS can also be sync with production.
    Thanks in advance.

  2. Brandon Carmichael

    Hi Anderson,

    These are great questions. Regarding your first question, unfortunately there is not a ‘select all and synch’ option. However, I have a solution that may work for you. With your project open, while holding down the Ctrl button you can select each object in the project. Once all the objects are selected, you can then choose Synchronize.

    Regarding your second question, you wouldn’t want to upload code from production into TFS. You may have code under development in your dev environment that is further along in the development process. That’s one of the values of having and using version control. I would think you would definitely want to keep the work you’ve already done.

    Thank you for your comments.

Submit a Comment

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

Upcoming Events


01sep10:00 am10:30 amEnsuring Quality and Compliance for Batch Manufacturers in Life Sciences

01sep12:00 pm12:30 pmIs it Worth It to Move to the Cloud? A Look at Considerations for Current Agribusinesses Using Dynamics GP

01sep2:00 pm2:45 pmWhat’s New in Dynamics 365 Finance and Supply Chain

09sep11:00 am12:00 pmConfab Live with Stoneridge – Data Strategy and Reporting – Mining Decision Making Insights

15sep10:00 am11:00 amSolving the Biggest Challenges in Agribusiness Through Innovation and Technology

22sep12:00 am12:30 pmSimplifying Payroll and HR Management with ADP Workforce Now

22sep10:00 am10:30 amStreamlining Batch Manufacturing with Technology

22sep2:00 pm2:30 pmProcess Automation for Microsoft Dynamics D365 for Business Central, Finance and Operations and GP

23sep11:00 am12:00 pmConfab LIVE with Stoneridge - Riding the Wave 2 Release – Key Features Coming to Dynamics 365 this October

29sep10:00 am11:00 amTop Five Reasons Why NOW is the Right Time to Move from Salesforce to Dynamics 365 Customer Engagement

29sep12:00 pm12:45 pmUnderstanding Job Costing and Tax Management in Business Central

29sep2:00 pm3:00 pmDigitalizing Horticulture & Agriculture - How to Sell Plants Online and Simplify Business Management

30sep12:00 pm4:00 pmSecurity and Permissions Training for D365 Business Central or Dynamics NAV


06oct10:00 am10:30 amPreview of D365 Business Central Fall Release Features and Functionality

06oct12:00 pm12:30 pmInsider's Guide to New Features Available in the Fall Release of D365 Finance and Supply Chain

07oct11:00 am12:00 pmConfab LIVE with Stoneridge - Dataverse and Dynamics in Review – Let’s Get Technical

13oct12:00 pm12:30 pmWave 2 Release – What’s Coming for Dynamics 365 Sales and Customer Service

21oct11:00 am12:00 pmConfab LIVE with Stoneridge - Dataverse and Dynamics in Review – Let’s Get Functional

26oct(oct 26)9:00 am28(oct 28)5:00 pmStoneridge Connect Leadership and Community Conference

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!