Skip to main content

Notifications

Announcements

No record found.

D365FO Model Management (export, Import and delete)

Sometimes D365FO developers facing the task to import, export, or delete models. Some ISV solutions are provided as model files, which contain programmable objects (metadata and code) and related resources. Also, all the systems customizations should be created in a model. In this blog post we will learn how to management models, using the Fleet Management Extension model as an example.

A model is a group of elements, such as metadata and source files, that typically constitute a distributable software solution and includes customizations of an existing solution. Also, a model is a design-time concept, for example a warehouse management model or a project accounting model. A model always belongs to a package. A package is a deployment and compilation unit of one or more models. It includes model metadata, binaries, and other associated resources. One or more packages can be packaged into a deployable package, which is the vehicle used for deployment on runtime environments.

 pastedimage1605283241602v1.png

Export a Model

Models can be exported, imported, and deleted using the ModelUtil.exe.

From the Start menu run command prompt as an administrator.

 pastedimage1605283252590v2.png

Run the following command in the command prompt.

K:\AosService\PackagesLocalDirectory\Bin\ModelUtil.exe -export -metadatastorepath=K:\AosService\PackagesLocalDirectory\ -modelname="FleetManagementExtension" -outputpath=C:\Temp

pastedimage1605283277692v3.png

This command exports the model Fleet Management Extension from the model store to a file. Upon successful completion you should be able to view the model file under the C:\temp folder as shown below.

 pastedimage1605283305617v4.png

Note: ‘K:’ drive will contain the model store in a Onebox development environment.

 

Delete a model

In the command prompt, run the following command to delete the model Fleet Management Extensions from the model store:

K:\AosService\PackagesLocalDirectory\Bin\ModelUtil.exe -delete -metadatastorepath=K:\AosService\PackagesLocalDirectory\ -modelname="FleetManagementExtension"

 

 pastedimage1605283334995v5.png

 Navigate to the package's local directory folder in the model store.

Note that that FleetManagementExtension package folder does not contain a subfolder for the  FleetManagementExtension model anymore.

 pastedimage1605283384056v6.png

 

Import a model

Finally, we will reimport the model FleetManagementExtension which was exported and deleted in the previous steps.

From the command prompt, run the following command to import the model file exported previously.

 

K:\AosService\PackagesLocalDirectory\Bin\ModelUtil.exe -import -metadatastorepath=K:\AosService\PackagesLocalDirectory\FleetManagementExtension -file="C:\Temp\FleetManagementExtension-Microsoft Corporation.axmodel"

pastedimage1605283409181v7.png 

If you check the model store you can see the model files and folder :

 pastedimage1605283431266v8.png

I hope this post can help you out, thanks for reading!

 

Acknowledgments: I want to thank my colleague Amy Flower (Customer Engineer) for her contributions and peer review.

Comments

*This post is locked for comments