我已经编写了从动态CRM中检索商机实体的代码,有什么办法可以根据收入只检索前五个实体吗?
答案 0 :(得分:3)
QueryExpression query_ = null;
RetrieveMultipleRequest requests_ = null;
query_ = new QueryExpression();
query_.EntityName = "opportunity";
query_.ColumnSet = new ColumnSet(true);
query_.Orders.Add(new OrderExpression("estimatedvalue", OrderType.Descending));
query_.PageInfo.Count = 5;
query_.PageInfo.PageNumber = 1;
requests_ = new RetrieveMultipleRequest();
requests_.Query = query_;
EntityCollection collection = _sdk.RetrieveMultiple(requests);
答案 1 :(得分:1)
在查询表达式中,您可以设置
queryExpression.PageInfo.Count = 5;
不要忘记在FetchXml中放置一个特定的订单,你可以这样设置:
<fetch mapping="logical" count="0" version="1.0">