Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
293 views
in Technique[技术] by (71.8m points)

dynamics crm - Is it possible to limit the amount of results returned in a response when using a QueryExpression in CRM 4

Basically I have a QueryExpression that returns over 3000 results. I only need to use between 50 and 200 of these. If I was using normal sql I could use SELECT TOP 200..... Is there a way to do this in CRM using the QueryExpression or FetchXML?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

In a QueryExpression:

QueryExpression query = new QueryExpression(); 
query.PageInfo = new PagingInfo();
query.PageInfo.Count = 200; // or 50, or whatever
query.PageInfo.PageNumber = 1;

In Fetch XML:

<fetch mapping='logical' page='1' count='200'>
...

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...