MS Dynamics CRM and Dynamics 365: Find Entity Logical name by only using Record primary key(GUID)
- Fetch all entities metadata.
- Iterate through them and execute a retrieve request on each entity for the given value(primary key as GUID).
- The execution which doesn't gives the exception is the answer.
- First call to CRM, get all entities metadata by specifying the EntityFilters as Entity.
- Create a list of Retrieve requests with retrieved entities and given value (GUID).
- Second CRM call, in Dynamics CRM we've a special request called ExecuteMultiple which is capable of executing maximum of 5000 calls by default. Create a ExecuteMultiple Request instance and add the created retrieve requests to the RequestCollection of the EntityMultiple request. And execute it in CRM.
- The response will not give you an exception but will give you a response with collection of responses. In which except one response all other will have IsFaulted=true.
- Third Part is finding the succeeded response. You can use LINQ to find which is easy to write for developers.
