Ran into an interesting issue when trying to import a solution into both Dynamics 365 on premise and Dynamics 365 online. Background: Did some major tweaking to some OOTB processes and decided to turn them off/deactivate them. Honestly can’t remember exactly how I broke it. But the fix is simple.
The exact error:
|Import has encountered an error and has been canceled. Your system has been restored to its original state. This customization file contains a reference to an entity map that does not exist on the target system.|
The solution to this is as followed:
- (Optional) Move the broken solution into a folder where you can extract and manage the files.
- Extract the solution file.
- Open the customisations.xml file.
- Search for parts of the “Name” within the customisations file, in my case I searched for “toop” (With only 1 occurrence) which looked like:
This piece of XML was causing the issue. The EntityTarget did not exist anywhere else and was causing the problem.
- Delete the above XML section from the customisations.xml file.
- Save the file.
- Copy the new xml file into the original downloaded solution.
- Re-Import the solution back into CRM.
Solution should now import.
From here onwards: Make sure you do any sort of patching as a patch.