【问题标题】:MSCRM Retrieve Multiple PlugIn limits the other Retrievemultiple ueryMS CRM Retrieve Multiple PlugIn 限制了其他 Retrievemultiple 查询
【发布时间】:2018-07-29 23:42:45
【问题描述】:

在我的场景中,Annotation 上有一个插件(Retrieve Multiple)。这个插件不仅仅是 BLOB 存储解决方案的一部分(用于微软提供的附件管理解决方案)。因此,很明显,在我们的 CRM 中,正在使用 MicrosoftlLabsAzureBlobstorage

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

{插件执行失败,因为当前没有沙盒主机 可用的。请检查您是否配置了沙盒服务器,并且 它正在运行。\r\nSystem.ServiceModel.CommunicationException: Microsoft Dynamics CRM 遇到错误。参考编号 管理员或支持:#AFF51A0F"}

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

所以,我的问题是 Rerieve Multiple Query 的数量是否有限制?如果retrievemultiple PlugIn 存在?

还有其他我找不到的线索吗?

【问题讨论】:

  • 这是在线实现还是内部部署?
  • 在线v8.2.2.2160
  • 你可以展示一些你的控制台应用程序代码,但我认为你必须向 MS 提出一张票
  • 已经跟进MS,他们也说出了我指出的相同原因。 Retrieve Multiple 上有一个插件,当我的代码使用 documentbody 检索多个注释时,这会导致问题,这会导致大尺寸。
  • 是的,但您是说该插件是 Microsoft 解决方案的一部分。这不是 CRM 的支持票,而是针对特定软件包的支持票

标签: plugins dynamics-crm crm dynamics-crm-365


【解决方案1】:

要解决此冲突,您可能希望在控制台应用程序代码中尝试检索较小的注释页面,例如一次 50 个,然后循环浏览页面以处理它们。

This article 提供了分页查询表达式的示例代码。

这是该示例的精简版:

// 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;
    }
}

This page 有更多信息和另一个示例。

【讨论】:

  • 我们与 BLOB 团队进行了通话,他们也说您需要一次执行小块而不是大块。有趣的是,当我禁用他们的插件(属于 BLOB)时,我的控制台应用程序运行良好。这是按照 2 分钟时间的框架,所以除了小块没有其他选择。谢谢
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多