在我的场景中,注释上有一个插件(检索多个插件)。这个插件并不仅仅是BLOB存储解决方案的一部分(用于Microsoft提供的附件管理解决方案)。因此,很明显,在我们的客户关系管理中,MicrosoftlLabsAzureBlobstorage正在被使用。
现在,我正在执行一个控制台应用程序,它通过查询表达式检索多个注释。当它试图获取500或600左右的记录时,它会抛出错误。
{由于当前没有沙箱主机可用,插件执行失败。请检查您是否配置了一个Sandbox服务器,并且它是running.\r\nSystem.ServiceModel.CommunicationException:,是否有一个错误。管理员或支持的参考编号:#AFF51A0F"}
当我获取特定的记录或更少的记录时,它执行得很好。
那么,我的问题是,Rerieve多个查询的数量是否有限制?是否存在检索仿真器PlugIn?
还有什么我找不到的线索吗?
发布于 2018-08-03 12:18:18
为了解决这个冲突,在控制台应用程序代码中,您可能希望尝试检索较小的注释页,比如每次50页,然后遍历这些页面来处理所有这些页面。
这篇文章提供了分页QueryExpression的示例代码。
下面是该示例的节略版本:
// 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;
}
}此页有更多的信息和另一个示例。
https://stackoverflow.com/questions/51585426
复制相似问题