在C#中显示超过5000条来自CRM的记录 [英] Show more than 5000 records from CRM in C#
问题描述
我试图了解FetchXml的工作方式(或其他任何方法),因为我想检索和处理超过CRM在下面的api调用中返回的5000条记录的限制.
I am trying to understand how FetchXml works (or any other method) because I want to retrieve and process more than the limit of 5000 records that CRM returns on the api call below.
我的基本网址如下: http://crm.domain.com:1234/api/data/v8.0/
资源为:电子邮件
和查询选项为: $ top = 50000& $ filter = description ne null且不包含(发件人,'@ not-interesting.com')
I'm trying to copy the code from https://docs.microsoft.com/en-us/previous-versions/dynamicscrm-2016/developers-guide/gg327917(v=crm.8)?redirectedfrom=MSDN
但是创建这样的 OrganizationServiceProxy
对象时遇到了问题:
but I'm having issues with creating the OrganizationServiceProxy
object like this:
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)找不到.
Metadata contains a reference that cannot be resolved: 'http://crm.domain.com:1234/data/v8.0/?wsdl&sdkversion=90'.' WebException: The remote server returned an error: (404) Not Found.
推荐答案
您将这两者混合了:
- Web API-v8.0之后可用
- 2011年终结点-现在已不推荐使用,但已经使用了很长时间
When you use web api the url will be like: https://yourcrm.crm#.dynamics.com/api/data/v8.0/
如果组织服务代理仍是2011年的终结点: https://yourcrm.crm.dynamics.com/XRMServices/2011/Organization.svc
In case of Organization Service Proxy still the 2011 endpoint: https://yourcrm.crm.dynamics.com/XRMServices/2011/Organization.svc
为打破5000条记录的限制&要获得超过5k的记录,必须使用分页概念.如何从CRM中获取5000多个实体
For breaking the 5000 records limitation & getting more than 5k records, the pagination concept has to be used. How to fetch more than 5000 entities from CRM
有关更多建议,我已经在 SO线程中回答了其他选项.
For more ideas, I have answered in this SO thread about other options.
这篇关于在C#中显示超过5000条来自CRM的记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!