Model import and export in D365 Finance and Operations using Powershell

 When we want to move customization done on specific model from one environment to other development environment we need to export and import the model file.

Steps for model import and export using PowerShell :-

  1. Open PowerShell in administrator mode.
  2. Change directory to the path of package bin folder.
    image
  3. Export command:-.\ModelUtil.exe -export -metadatastorepath=C:\AOSService\PackagesLocalDirectory -modelname=”name of model” -outputpath=path to store model after exportFor example:

    If model name is TOUpgradeModel and I want to store the model file to path is C:\Temp\ModelFile

    The command will be as follows:

    .\ModelUtil.exe -export -metadatastorepath=K:\AosService\PackagesLocalDirectory -modelname=”TOUpgradeModel” -outputpath=C:\Temp\ModelFile
    imageOutput file you can see on the specified path as
    image

  4. Import Command :-.\ModelUtil.exe -import -metadatastorepath=C:\AOSService\PackagesLocalDirectory -file=the path from. axmodel to importFor example:
    image

    .\ModelUtil.exe -import -metadatastorepath=C:\AOSService\PackagesLocalDirectory -file=C:\Temp\ModelFile\TOUpgradeModel-Cloudfront.axmodel
    image

    ( Note : If model already exist in your environment, trying to import the same model you will     receive the error message of “Model already exist”. So, delete the existing model by command

    .\ModelUtil.exe -delete -metadatastorepath=C:\AOSService\PackagesLocalDirectory -modelname=” TOUpgradeModel ”

    try to import the model)

Comments

Popular posts from this blog

Customization on Sales invoice Report in D365 F&O

75) COC - Create a coc of the table modified method

46) D365 FO: SHAREPOINT FILE UPLOAD USING X++