Search code examples
dynamics-crmmicrosoft-dynamicsfetchxml

Can I use FetchXML to retrieve an entity by guid when object type not known?


I have an error log file that contains a GUID of an Entity in Microsoft Dynamics CRM 365 Online, but I do not know the Entity's object type. Is there a way of using FetchXML (or otherwise) to retrieve any Entity with the matching GUID regardless of object type?


Solution

  • A possibility is to retrieve the metadata of all entities (using the RetrieveAllEntitiesRequest message) and after to an IOrganizationService.Retrieve to check if the record exits or not.

    You can find a complete example in this blog post:

    Retrieve Entity Logical Name from a record GUID