我试图了解FetchXml的工作方式(或任何其他方法),因为我想检索和处理的内容超过了CRM在下面的api调用中返回的5000条记录的限制。

我的基本网址看起来像这样:http://crm.domain.com:1234/api/data/v8.0/

资源是:emails

和查询选项为:$top=50000&$filter=description ne null and not contains(sender, '@not-interesting.com')

我正在尝试从中复制代码
https://docs.microsoft.com/en-us/previous-versions/dynamicscrm-2016/developers-guide/gg327917(v=crm.8)?redirectedfrom=MSDN

但是创建这样的OrganizationServiceProxy对象时遇到了问题:

var creds = new ClientCredentials();
creds.UserName.UserName = CrmApiUsername;
creds.UserName.Password = CrmApiPassword;

using (var _serviceProxy = new OrganizationServiceProxy(
            new Uri(CrmApiBaseAddress), null, creds, null))
        {
            // This statement is required to enable early-bound type support.
            _serviceProxy.EnableProxyTypes(); // ...


我收到一个错误:


  元数据包含无法解析的引用:“ http://crm.domain.com:1234/data/v8.0/?wsdl&sdkversion=90”。
  WebException:远程服务器返回错误:(404)找不到。

最佳答案

您将这两者混合在一起:


Web API-v8.0之后可用
2011年的终结点-现在已弃用,但已经使用了很长时间


Read more

当您use web api时,URL将类似于:https://yourcrm.crm#.dynamics.com/api/data/v8.0/

如果Organization Service Proxy仍是2011终结点:https://yourcrm.crm.dynamics.com/XRMServices/2011/Organization.svc

为了突破5000条记录限制并获得超过5k条记录,必须使用分页概念。 How to fetch more than 5000 entities from CRM

有关更多想法,我已在此SO thread中回答了其他选项。

关于c# - 在C#中显示来自CRM的5000多个记录,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/58877367/

10-13 09:06