2

我已经编写了从动态 CRM 中检索机会实体的代码,有什么方法可以根据收入仅检索前五个实体?

4

2 回答 2

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);
于 2013-03-25T18:17:50.727 回答
1

在查询表达式中,您可以设置

queryExpression.PageInfo.Count = 5;

不要忘记放置一个特定的顺序,在 FetchXml 中你可以这样设置:

<fetch mapping="logical" count="0" version="1.0">
于 2013-03-25T10:24:32.210 回答