2

When I try to execute the request to GET ../api/data/<version>/officedocuments and at least 10 entities, I get an error:

{"error":{"code":"0x80040800","message":"The 'RetrieveMultiple' method does not support entities of type 'officedocument'."}}

The same problem I faced when I was trying to get full JSON of specific entity records

{"error":{"code":"0x80040800","message":"The 'Retrieve' method does not support entities of type 'roletemplate'."}}

Can someone suggest me how can I list all entity records for example for officedocumententity and get full JSON for mentioned above roletemplate records?

Pavlo Mykhailyshyn
  • 203
  • 1
  • 6
  • 20

2 Answers2

2

If its not allowed/supported means we cannot do it that way. So if you need that entity, then use the workaround of using web api with fetchxml.

https://crmdev.crm.dynamics.com/api/data/v9.1/roletemplates?fetchXml=<fetch> <entity name="roletemplate" > <attribute name="name" /> <attribute name="roletemplateid" /> </entity> </fetch>

Clear query is like below:

<fetch>
  <entity name="roletemplate" >
    <attribute name="name" />
    <attribute name="roletemplateid" />
  </entity>
</fetch>

Similarly, Workaround for that query is using ExecuteFetchRequest

//Try with IOrganizationService
      var orgService = new OrganizationService(connection);
      //Works
      var orgSvcExecuteFetchResponse = (ExecuteFetchResponse)orgService.Execute(executeFetchReq);
      //Doesn't work
      var orgSvcRetrieveMultipleResponse = orgService.RetrieveMultiple(new FetchExpression(fetch));

      //Try with CrmServiceClient:
      var crmSvcClient = new CrmServiceClient(connectionString);
      //Works
      var crmSvcExecuteFetchResponse = crmSvcClient.Execute(executeFetchReq);
      //Doesn't work
      var crmSvcRetrieveMultipleResponse = crmSvcClient.RetrieveMultiple(new FetchExpression(fetch));

List of RetrieveMultiple supported entities can be found here.

0

The hack from @Arun's answer doesn't work anymore. Using fetchXml results now in the same error.

On Microsoft Dynamics 365 docs, it is explicitly mentioned that roletemplate and bunch of other entities are for internal use only and are not meant for developer use.

gdrt
  • 3,160
  • 4
  • 37
  • 56