Microsoft D365 F&O: Remove custom models from deployable package



Sometime we deploy custom model to PROD/Sandbox and due to some reason needs to revert back custom model code. If we revert back code, code reverted back but model still exist in the environment. the next time when we suppose to deploy new package, deployment would failed with following reason:

"The selected package is missing the following modules that are currently deployed on your environment. You must create an all-in-one deployable package that contains all your code customizations and ISV solutions. More information can be found at the following link: https://go.microsoft.com/fwlink/?linkid=2118104. Missing module(s): [ Package1 ] ,[ Package2 ] [ Package3 ]’ (Activity Id: ‘12345XXXX’)"

I will explain how to remove the custom models from your environment(PROD/Sandbox).

Steps

1. Create a deployable package from your VM(Visual studio) or download the build package

2.  Unzip the deployable package and open the deployable package folder.

3. Go to  \AXDeployablePackage.zip\AOSService\Scripts

and create a new text file call ModuleToRemove.txt and add the list of modules which you want to remove and place the file at location\AXDeployablePackage.zip\AOSService\Scripts


4. Remove the custom models folders those you want to uninstall( refer the LCS deployment error message for list of models)


5. Remove the model package from the following path


6. modify "MetadataModuleList" & "AllComponentList -> ArrayOfString" in the     HotfixInstallationInfo.xml file

<MetadataModuleList>

    <string>Failed_Model1.7.0.XXXX.01</string>
    <string>Failed_Model2.7.0.XXXX.01</string>
    <string>Failed_Model3.7.0.XXXX.01</string>
    <string>XYZ.7.0.XXXX.01</string>
...

</MetadataModuleList>
  <MetadataModelList />
  <PlatformReleaseDisplayName>Update64</PlatformReleaseDisplayName>
  <PlatformVersion>7.0.XXXX.01</PlatformVersion>
  <IsCompatibleWithSealedRelease>true</IsCompatibleWithSealedRelease>
  <IsCompatibleWithApp81PlusRelease>true</IsCompatibleWithApp81PlusRelease>
  <AllComponentList>
    <ArrayOfString>
      <string>AX Module</string>
      <string>Failed_Model1.7.0.XXXX.01</string>
    </ArrayOfString>
    <ArrayOfString>
      <string>AX Module</string>
      <string>Failed_Model2.7.0.XXXX.01</string>
    </ArrayOfString>



7. Zipped the Deployable Package contents outside of the root folder


8. Upload the Zip deployable package on LCS > Asset library and verify the uploaded deployment package status on LCS. Once all looks good start the deployment    














Comments

Popular posts from this blog

Execute D365 F&O SSRS report with parameter and upload report output on Azure blob storage using X++

Generate Text/CSV/DAT file using X++ and upload on Azure blob storage