Replace a Model in AX7 / D365
Like stated in the official Im- / Export Model “Docs” article from Microsoft, we can use the ModelUtil.exe to im- / export and delete models in AX 7. But if you take a detailed look at it, you will see it provides you with another option – replace.
If you look at my try to get help on the command, you will see the replace option:
Why replace a Model?
What is does is a simple delete (it will prompt for confirmation) and then an import in just one statement. Why? I often use it for importing an updated model into an “One Box”, it just saves some time and I only have one command to remember.
How to use it?
The ModelUtil.exe is located inside the “PackagesLocalDirectory\bin” folder. Just cd into and call it with the option -replace, the path to the metadatastore (-metadatastorepath) (the full-path to “PackagesLocalDirectory“) and the full-path to the model you want to import with the -file parameter.
Now, if a model exists which is equal to the model in your linked file, the installed model will be replaced by your given file.