此错误在 Dynamics CRM /api/data/<version> 中意味着什么 "The 'RetrieveMultiple' method does not support entities of type"?

What does this error mean "The 'RetrieveMultiple' method does not support entities of type" in Dynamics CRM /api/data/<version>?

当我尝试对 GET ../api/data/<version>/officedocuments 和至少 10 个实体执行请求时,出现错误:

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

我在尝试获取特定实体记录的完整 JSON 时遇到的同样问题

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

有人可以建议我如何列出 officedocument 实体的所有实体记录并获得上述 roletemplate 记录的完整 JSON 吗?

如果不是allowed/supported 意味着我们不能那样做。因此,如果您需要该实体,请使用将 web api 与 fetchxml.

结合使用的解决方法
https://crmdev.crm.dynamics.com/api/data/v9.1/roletemplates?fetchXml=<fetch> <entity name="roletemplate" > <attribute name="name" /> <attribute name="roletemplateid" /> </entity> </fetch>

清除查询如下:

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

同样,该查询的解决方法是使用 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.

@Arun 的回答中的 hack 不再有效。使用 fetchXml 现在会导致相同的错误。

Microsoft Dynamics 365 docs 上,明确提到 roletemplate 和许多其他实体仅供内部使用,不适合开发人员使用。