Sunday, January 10, 2021

How to Export and Import Models in D365 FO

 Once of the most common requirements before moving the code between multiple environments is to take the model backup from the source environment and restore the same in the destination environment.

Here's how we can achieve that in few simple steps mentioned below : - 

1) Open Command Prompt as Administrator

2) Go to the path C:\AOSService\PackagesLocalDirectory\bin

3) For Exporting the model type the below command : - 

ModelUtil.exe -export -metadatastorepath=k:\aosservice\packageslocaldirectory -modelname="MyCustomModel" -outputpath=c:\NewFolder

Note : - Output path is the desired path of the user where the file has to be exported

The Above command will generate .axmodel file which can be used later to import the model in the D365 Model Metadata repository

For Importing the already exported model through .axmodel file use the below command in the same location C:\AOSService\PackagesLocalDirectory\bin  : -

ModelUtil.exe -import -metadatastorepath=k:\aosservice\packageslocaldirectory -file=c:\NewFolder\MyCustomModel.axmodel

4) Once the import is complete Open Visual Studio as Administrator

5) Go to Dynamics 365 Menu --> Model Management -->Refresh Models

That's it you will be able to access all the Model Elements in your future customizations

As a best practice its always recommended to do Full Build of the models after the import is completed.

No comments:

Post a Comment

How to reverse Free Text Invoice Voucher entries without Dialog

 Hey Folks ,  This blog post is in continuation of the previous post for Reversing Free Text Invoice Voucher entries with Dialog. Only diffe...