首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >MSCRM检索多个PlugIn限制其他检索

MSCRM检索多个PlugIn限制其他检索
EN

Stack Overflow用户
提问于 2018-07-29 23:42:45
回答 1查看 821关注 0票数 1

在我的场景中,注释上有一个插件(检索多个插件)。这个插件并不仅仅是BLOB存储解决方案的一部分(用于Microsoft提供的附件管理解决方案)。因此,很明显,在我们的客户关系管理中,MicrosoftlLabsAzureBlobstorage正在被使用。

现在,我正在执行一个控制台应用程序,它通过查询表达式检索多个注释。当它试图获取500或600左右的记录时,它会抛出错误。

{由于当前没有沙箱主机可用,插件执行失败。请检查您是否配置了一个Sandbox服务器,并且它是running.\r\nSystem.ServiceModel.CommunicationException:,是否有一个错误。管理员或支持的参考编号:#AFF51A0F"}

当我获取特定的记录或更少的记录时,它执行得很好。

那么,我的问题是,Rerieve多个查询的数量是否有限制?是否存在检索仿真器PlugIn?

还有什么我找不到的线索吗?

EN

回答 1

Stack Overflow用户

发布于 2018-08-03 12:18:18

为了解决这个冲突,在控制台应用程序代码中,您可能希望尝试检索较小的注释页,比如每次50页,然后遍历这些页面来处理所有这些页面。

这篇文章提供了分页QueryExpression的示例代码。

下面是该示例的节略版本:

代码语言:javascript
复制
// The number of records per page to retrieve.
int queryCount = 3;
// Initialize the page number.
int pageNumber = 1;
// Initialize the number of records.
int recordCount = 0;

// Create the query expression
QueryExpression pagequery = new QueryExpression();
pagequery.EntityName = "account";
pagequery.ColumnSet.AddColumns("name", "emailaddress1");                   

// Assign the pageinfo properties to the query expression.
pagequery.PageInfo = new PagingInfo();
pagequery.PageInfo.Count = queryCount;
pagequery.PageInfo.PageNumber = pageNumber;

// The current paging cookie. When retrieving the first page, 
// pagingCookie should be null.
pagequery.PageInfo.PagingCookie = null;

while (true)
{
    // Retrieve the page.
    EntityCollection results = _serviceProxy.RetrieveMultiple(pagequery);
    if (results.Entities != null)
    {
        // Retrieve all records from the result set.
        foreach (Account acct in results.Entities)
        {
            Console.WriteLine("{0}.\t{1}\t{2}", ++recordCount, acct.Name,
                               acct.EMailAddress1);
        }
    }

    // Check for more records, if it returns true.
    if (results.MoreRecords)
    {
        // Increment the page number to retrieve the next page.
        pagequery.PageInfo.PageNumber++;

        // Set the paging cookie to the paging cookie returned from current results.
        pagequery.PageInfo.PagingCookie = results.PagingCookie;
    }
    else
    {
        // If no more records are in the result nodes, exit the loop.
        break;
    }
}

此页有更多的信息和另一个示例。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/51585426

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档