I'm Joris "Interface" de Gruyter. Welcome To My

Code Crib

Changing a Model Name When Using TFS on AX 2012

Apr 30, 2012
Filed under: #daxmusings #bizapps

One of the challenges we recently faced was renaming a model on an AX 2012 system that is hooked up to TFS. As it turns out, it’s not a big deal, really.

  1. Make sure everyone is off the system, shutting down the AOS may be a good idea too.

I’m not certain how much trouble you would be in changing the model while the AOS is running or someone is on the system, but at the very least you want to avoid issues with the TFS paths.

  1. Rename the model folder in TFS (optional).

Open up Visual Studio, browse to the model folder in source control and rename the model folder. Now, keep in mind that technically the name of the folder in TFS does not have to match the name of the model (although I find it much more intuitive of course).

  1. Edit the model.xml file in TFS to reflect the new name.

I’m not entirely certain what AX uses the model manifest for after it’s been created, but we use it in our build scripts, and it’s probably just good bookkeeping to changing the name everywhere.

  1. Edit the vcsdef.xml.

the vcsdef.xml file resides in the Definition folder of your source control tree, and maps model names to folders in your source control. This comes back to the point that the folder name does not necessarily have to match the name of the model. The vcsdef.xml file has a node where you will see your models and folders listed.

  1. Use AxUtil or the powershell cmdlets to change the name property of your model.

Using AXUTIL: axutil edit /model:MYMODEL /manifest:Name=MyModelNewName

Using PowerShell: Edit-AXModelManifest -Model MYMODEL -Property “Name = MyModelNewName”

Optionally you can also used the updated model manifest file to update the model store to the new name.

  1. Make sure you pull all the updated TFS stuff into your local AX workspace.

Depending on where you launched Visual Studio to make the changes, and depending what workspace you were using there, the vcsdef.xml file (and new folder name, model.xml, etc) may not be updated in the repository that your AX client is using. Make sure you pull the latest changes down!

  1. Restart AOS and AX 2012 won’t realize anything happened at all.

Log into AX and you shouldn’t have any problems with your renamed model.


There is no comment section here, but I would love to hear your thoughts! Get in touch!

Blog Links

Blog Post Collections

Recent Posts