Issue Description:

 

Exporting the Model Driven App “Field Service Mobile” from DEV to UAT. Recently the importing is getting failed with an error message: “Import of app module(s) failed: Entity ‘appsetting’ With Id = xxxxxxxxxxxxxxxxxxxxxx Does Not Exist”.


Initial Analysis by Microsoft:

 

Microsoft have confirmed that the attribute and relationship layering is consistent now. The product group has executed the mitigation scripts on the consolidated solution successfully.

Retrying the import of the consolidated solution had failed again with the following error:

The uninstall operation will delete the base layer for the component ‘AppSetting’ with id ‘xxxxxxxxxxxxxxxxxxxxxxx’. The operation cannot continue because there are other managed layers over the base layer. You can use the solution layers to find out which other solutions are blocking the operation.

 

 

Further Analysis:

 

The import on the target environment started successfully after the product group has executed the mitigation scripts on the consolidated solution successfully. But the second part of the solution imports is uninstall operation (default) that deletes the base layer is failing.

Microsoft.Crm.CrmException: The uninstall operation will delete the base layer for the component ‘AppSetting’ with id ‘xxxxxxxxxxxxxxxxxxxxxxx‘. The operation cannot continue because there are other managed layers over the base layer.

Product group identified that the issue was due to AppSettings layering on the target org. When trying to upgrade a solution, and in the upgrade solution two appsettings are missing and that is causing the appSettings to be deleted from the target org. But in the target org there is another managed layer that sits on top for those two settings, hence causing the upgrade to fail.

The reason for the upgrade solution is missing those settings could be the unintended click on the “Reset to environment value” link that caused the appsettings in the dev to go to soft deleted state and hence those settings were not exported in the upgrade solution.


Solution (Fix):


Microsoft product group had run the mitigation script on the development organization (Consolidated Solution) to remove the soft deleted layers of the appsetting xxxxxxxxxxxxxxxxxxxxxxxxx, which is the app override on setting definition MobileCommandingImprovements2022Tablet for FS Mobile App, and then the solution is left only with one managed layer.

Post the mitigation script execution, we were able to successfully import (upgrade) the consolidated solution in the target environment.

Incase, if the appsettings are still visible in the customizations.xml file:


The customizations.xml file can be updated to the following:


<appsetting settingdefinitionid.uniquename=”MobileCommandingImprovements2022″>
  <iscustomizable>1</iscustomizable>
  <value>true</value>
</appsetting><appsetting settingdefinitionid.uniquename=”MobileCommandingImprovements2022Tablet”>
  <iscustomizable>1</iscustomizable>
  <value>true</value>
</appsetting>