2

Google 検索から学んだように、MSCRM 2011 は最大 5000 個のエンティティを取得しますが、すべてのエンティティをマーケティング リストから取得したいと考えています。HKLM\Software\Microsoft\MSCRM に「TurnOffFetchThrottling」フィールドを作成し、値を 1 に設定すると、この 5000 制限の問題を解決できる Web に書かれているように (さらに、レジストリに MaxRowsPerPage フィールドを追加し、その値を 5000 以上に設定しました。しかし、それも機能しません)。試してみたところ、System.OutOfMemory Exception エラーが発生しました。ところで、"" を削除して id 属性コードを取得するだけで完全に機能しますが、すべての属性が必要です。ここに私のfetchxmlコード:

enter code here
string fetchXml = "<fetch mapping='logical' >"
                  + "<entity name='" + entityType.LogicalName + "'>"
                    + "<all-attributes />"
                    + "<link-entity name='listmember' to='" + entityType.LogicalName + "id" + "' from='entityid'>"
                        + "<filter>"
                          + "<condition attribute='listid' operator='eq' value='" + chosenMarketingListGuid + "'/>"
                        + "</filter>"
                    + "</link-entity>"
                  + "</entity>"
                + "</fetch>";

もう1つ試してみました。fetchxmlを次のように変更しました。

enter code here
string fetchXml = "<fetch mapping='logical' >"
                  + "<entity name='listmember'>"
                    + "<all-attributes />"
                        + "<filter>"
                          + "<condition attribute='listid' operator='eq' value='" + chosenMarketingListGuid + "'/>"
                        + "</filter>"
                  + "</entity>"
                + "</fetch>";

ご覧のとおり、連絡先/リード/アカウントのエンティティ タイプではなく、メンバー リストのみを取得しようとしましたが、うまくいきました。ただし、メンバーリストではなく、連絡先/リード/アカウントのエンティティ タイプが必要です。誰かがこの暗い MSCRM トンネルから抜け出すのを手伝ってくれたら、とても感謝します!

ここでは、完全なスタック トレース:

[OutOfMemoryException: 'System.OutOfMemoryException' 型の例外がスローされました。] System.ServiceModel.Security.SecurityUtils.ReadContentAsBase64(XmlDictionaryReader リーダー、Int64 maxBufferSize) +197 System.ServiceModel.Security.EncryptedData.ReadCipherData(XmlDictionaryReader リーダー、Int64 maxBufferSize) + 17 System.ServiceModel.Security.EncryptedType.ReadFrom(XmlDictionaryReader リーダー、Int64 maxBufferSize) +858 System.ServiceModel.Security.WSSecurityOneDotZeroReceiveSecurityHeader.DecryptBody(XmlDictionaryReader bodyContentReader、SecurityToken トークン) +80 System.ServiceModel.Security.WSSecurityOneDotZeroReceiveSecurityHeader.ExecuteMessageProtectionPass(Boolean hasAtLeastOneSupportingTokenExpectedToBeSigned) +1611 System.ServiceModel.Security.ReceiveSecurityHeader.Process(TimeSpan タイムアウト、ChannelBinding channelBinding, ExtendedProtectionPolicy extendedProtectionPolicy) +1576 System.ServiceModel.Security.MessageSecurityProtocol.ProcessSecurityHeader(ReceiveSecurityHeader securityHeader, Message& message, SecurityToken requiredSigningToken, TimeSpan timeout, SecurityProtocolCorrelationState[] correlationStates) +205 System.ServiceModel.Security.SymmetricSecurityProtocol.VerifyIncomingMessageCore(Message& message,文字列アクター、TimeSpan タイムアウト、SecurityProtocolCorrelationState[] correlationStates) +637 System.ServiceModel.Security.MessageSecurityProtocol.VerifyIncomingMessage(Message& メッセージ、TimeSpan タイムアウト、SecurityProtocolCorrelationState[] correlationStates) +371 System.ServiceModel.Channels.SecurityRequestChannel.ProcessReply(メッセージ応答、SecurityProtocolCorrelationState)相関状態、TimeSpan タイムアウト) +471 System.ServiceModel.Channels.SecurityRequestChannel.Request(メッセージ メッセージ、TimeSpan タイムアウト) +175 System.ServiceModel.Dispatcher.RequestChannelBinder.Request(メッセージ メッセージ、TimeSpan タイムアウト) +22 System.ServiceModel.Channels.ServiceChannel.Call (文字列アクション、Boolean oneway、ProxyOperationRuntime 操作、Object[] ins、Object[] outs、TimeSpan タイムアウト) +517 System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall、ProxyOperationRuntime 操作) +88 System.ServiceModel.Channels.ServiceChannelProxy .Invoke(IMessage メッセージ) +453 System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 型) +237 Microsoft.Xrm.Sdk.IOrganizationService.RetrieveMultiple(QueryBase クエリ) +0 Microsoft.Xrm.Sdk.Client .OrganizationServiceProxy.RetrieveMultipleCore(QueryBase クエリ) +626 Microsoft.Xrm.Sdk.Client.OrganizationServiceProxy.RetrieveMultiple(QueryBase クエリ) +39 IMPlugin.MarketingListHelper.getMembersAndCountOfChosenMarketingList(OrganizationServiceProxy サービス、Guid selectedMarketingListGuid、Entity entityType) in C:\Users\Zafer\Documents \Visual Studio 2010\Projects\IMPlugin\MarketingListHelper.cs:130 IMPlugin.IM_SMS.fillMainPanel(Double mainPanelHeight) in C:\Users\Zafer\Documents\Visual Studio 2010\Projects\IMPlugin\IM_SMS.aspx.cs:96 IMPlugin. C:\Users\Zafer\Documents\Visual Studio 2010\Projects\IMPlugin\IM_SMS.aspx.cs:42 の IM_SMS.Page_Load(Object sender, EventArgs e) System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o 、オブジェクト t、EventArgs e) +14 System.Web.Util.CalliEventHandlerDelegateProxy。Callback(Object sender, EventArgs e) +35 System.Web.UI.Control.OnLoad(EventArgs e) +91 System.Web.UI.Control.LoadRecursive() +74 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint 、ブール値 includeStagesAfterAsyncPoint) +2207

4

1 に答える 1

5

5000 の制限が存在する理由は、発生している問題を正確に防ぐための大雑把な障壁です。ソフトウェアの制限を回避したので、ハードウェアの制限 (メモリ不足) を克服する必要があります...

コードの記述方法や結果の使用目的については述べていませんが、クエリの実行後に追加の処理があると思います。これに基づいて、クエリ式にページングを導入し、5000 のバッチでレコードを処理することをお勧めします。

大まかな例:

// get records to process
string pagingCookie = null;
bool moreRecords = false;
int pageNum = 1;
DataCollection<Entity> myBatchOfRecords;    

bool continueProcessing = true;
while (continueProcessing)
{
    myBatchOfRecords = GetRecords(pageNum, ref pagingCookie, ref moreRecords);

    // process those records
    ProcessRecords(myBatchOfRecords);
    pageNum++;    
    continueProcessing = moreRecords;
}

function DataCollection<Entity> GetRecordsList(int pageNumber, ref string pagingCookie, ref bool moreRecords){
    var query = new QueryExpression(blahblahblah...);
    query.PageInfo = new PagingInfo { 
        Count = 5000, 
        PageNumber = pageNumber, 
        PagingCookie = pagingCookie };
    var results =  myOrgService.RetrieveMultiple(query);
    pagingCookie = matchedContacts.PagingCookie;
    moreRecords = matchedContacts.MoreRecords;
    return results;
}
于 2012-07-23T11:50:48.210 に答える