Monday, April 30, 2012

Changing a Model Name When Using TFS on AX 2012

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.

2. 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).

3. 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.

4. 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.

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

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.

6. 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!

7. 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.


  1. Hi Joris,
    Does the above apply when each developer has their own VM and is connected in to TFS?

    1. Sure, remember that any of the steps that say "AOS" or "AX Workspace" need to be done on each VM. I believe that Martin Drab has some info about renaming also, on his blog at - you'll have to search for it tho.

  2. Example for using xml File to update the model manifest

    C:\Windows\system32> Edit-AXModelManifest -Model "ModelName" -ManifestFile "C:\FolderName\ModelManifestChange.xml"

  3. Hello, I'm encountering an issue with updating the model manifest. Edit-AXModelManifest is giving me the following error:
    System model VAR Model cannot be edited.
    The manifest properties for the VAR Model model failed to update.

    I'm using the command as Edit-AXModelManifest -Model "VAR Model" -manifestfile F:\TFSRepo\VAR\Model.xml

    can anyone help please? I'm able to edit the manifest for another model on the same system.

    1. You should always create your own model. "Var Model" is a system model for the VAR layer in case you didn't use an explicitly created one. Those models' properties cannot be edited or changed because they are default system ones.

    2. Thank you Joris. That was helpful.

  4. I’m not the creative mind of my business, but I need to come up with names for new products we’re shipping out. I’m thinking of talking to the people behind this portfolio
    , hopefully joining their ranks, as the names they’ve come up with are top notch. Do you think this is a good move?