1
votes

Since recently I'm getting an error in a Dynamics 365 updated CRM OL when rendering a report. Now when I test in VS, it also shows this error. It says the following:

Could not create a list of fields for the query. verify that you can connect to the data source and that your query syntax is correct. The specified record type does not exist in Microsoft Dynamics CRM. The entity "XXX" cannot be found. Specify a valid query and try again. The entity with a name = 'XXX' was not found in the MetadataCache

I can connect, this always worked using the CRM OL Link, credentials are the same and the entity is there. I just copied the fetchxml from my advanced find, so pretty sure it's there.

3

3 Answers

1
votes

I don't know of any changes to 365 that should break this. However, what I would do to fix it is create a report using the wizard that uses this same entity. Download that report and check the following:

  • Data Source - Are there any slight differences in Data Source name and/or connection string?
  • Data Set - Are there any subtle differences in the FetchXML from casing to versions etc?

That should point out the problem. If not, and that downloaded report works, either just copy in the attributes etc you need into the new report and go with that instead (it might be some xml within the report itself). Or if your report has nothing on it you could start comparing the raw xml of the 2 reports to see what is different.

0
votes

This error: "The entity with a name = 'XXX' was not found in the MetadataCache" is quite common error with caching in CRM (Metadata is cached to speed things up). On On-Premise environemtns the thing that usually helps is simple IISRESET, which is not an option for CRM Online. I would try obvious solutions like re-publishing all customizations in CRM (from my experience it rarely helps for this error, but it's worth a shot), maybe adding some dummy plugin (and then removing it). If you will be still getting this error, then contacting MS Support should be your next move (also IIS AppPools are resetted after some time, so maybe tomorrow it will work - seems like a bad joke but actually it's true...)

0
votes

If you have multiple instances of CRM make sure you point to the correct one but adding ;crminstance; at the end of the connection string. This solved the problem for me.