You may encounter an error where the sitemap for Organzation xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx contains a reference to the entity “entity_name,” but that entity was not found in the metadata cache.
This error shows up in the Application Event Log of the CRM web server when there are references to entities that do not exist in the sitemap. The most common reason for this issue may be when customizations are moved between environments and entities get deleted in this process, but the sitemap still has references to them. Below are the steps to resolve this error and stop the errors from appearing in the Event Log. It’s a good way to keep things clean in the CRM sitemap.
- Go to the Application Event Log of the CRM server and copy the GUID of the Organization and the entity name which is throwing the error. (Ignore this step if there is only one organization.)
- Find the name of the Organization by querying the CRM database using the following statements. (Again, ignore if there is only one Organization.)
from Organization where ID=
‘xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'[Enter the organization ID you found in the event log]
- Create a new unmanaged solution with just the sitemap and export the solution for the organization identified in step 2 (or just the organization if it is the only one).
- Make a back-up of this solution if something goes wrong with editing the XML and you need to revert to its original state before the change. Unzip the files of the solution and open the customizations.xml file.
- In the XML, search for the entity name found in the event log and see if there are any tags that start with “<SubArea Id=”entity_name_found_in_event_logs”Â ” or “<Area Id=” entity_name_found_in_event_logs”Â ” or “<Group Id=” entity_name_found_in_event_logs”Â “. Basically, look for all the references of this entity name, and remove those sections from the sitemap.
- Once all the reference are removed, re-package the solution (remember, you need to create a zip file of all the files in the unzipped folder) into a new .zip file and import it back into CRM.
- Finally publish the customization upon successful import. This should fix the error.
It’s important to note that the user performing the above process must have the following privileges:
- System Administrator/System Customizer role in CRM
- Local Administrator access on CRM web server machine
- Local Administrator on SQL server for CRM and select permission on the MSCRM_CONFIG database
Also, when deleting anything in Microsoft Dynamics CRM, always back up the customizations. You might specifically back up the sitemap before editing and re-import this solution in case something goes wrong with the sitemap update.