簡體   English   中英

在 C# 中顯示來自 CRM 的 5000 多條記錄

[英]Show more than 5000 records from CRM in C#

我試圖了解 FetchXml 的工作原理(或任何其他方法),因為我想檢索和處理超過 CRM 在下面的 api 調用中返回的 5000 條記錄的限制。

我的基礎 url 看起來像這樣: 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 object 時遇到問題,如下所示:

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)未找到。

你混淆了這兩個:

  1. Web API - 在 v8.0 之后可用
  2. 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

為了打破 5000 條記錄的限制並獲得超過 5k 條記錄,必須使用分頁概念。 如何從 CRM 中獲取 5000 多個實體

有關更多想法,我已經在這個SO 線程中回答了其他選項。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM