Skip to main content

Notifications

Customer experience | Sales, Customer Insights,...
Suggested answer

Limit number of records returned by view

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

I have one view and this view returns more than 5.000 records.
I want to return only one record. All records are created on the same day so I cannot use sorting by CreatedOn column.

I used FetchXML Builder to modify view definition and now it is like this:

<fetch version="1.0" top="1" output-format="xml-platform" mapping="logical">

When I execute this view in FetchXML Builder i get only one row in results.

After I saved this view in CRM I tried to get records and I still see more than 5.000 records.
The requirement is to return only one record.

CRM version: 1612 (9.0.19.8) (DB 9.0.19.8) on-premises

  • Suggested answer
    SamiraM Profile Picture
    SamiraM 571 on at
    RE: Limit number of records returned by view

    Try count like below:

    <fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="true" count="10">

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Limit number of records returned by view

    Hi,

    did you publish the entity after saving the view?

  • RE: Limit number of records returned by view

    Hello, it should work, but a question after saving it, it also has been published?

    Thanks!

    Community Support Team - Esteban

    If this Post helps, then please consider Accept as solution to help the other members find it more quickly.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    Limit number of records returned by view

    I have one view and this view returns more than 5.000 records.
    I want to return only one record. All records are created on the same day so I cannot use sorting by CreatedOn column.

    I used FetchXML Builder to modify view definition and now it is like this:

    <fetch version="1.0" top="1" output-format="xml-platform" mapping="logical">

    When I execute this view in FetchXML Builder i get only one row in results.

    After I saved this view in CRM I tried to get records and I still see more than 5.000 records.
    The requirement is to return only one record.

    CRM version: 1612 (9.0.19.8) (DB 9.0.19.8) on-premises

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    Limit number of records returned by view

    I have one view and this view returns more than 5.000 records.
    I want to return only one record. All records are created on the same day so I cannot use sorting by CreatedOn column.

    I used FetchXML Builder to modify view definition and now it is like this:

    <fetch version="1.0" top="1" output-format="xml-platform" mapping="logical">

    When I execute this view in FetchXML Builder i get only one row in results.

    After I saved this view in CRM I tried to get records and I still see more than 5.000 records.
    The requirement is to return only one record.

    CRM version: 1612 (9.0.19.8) (DB 9.0.19.8) on-premises

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    Limit number of records returned by view

    I have one view and this view returns more than 5.000 records.
    I want to return only one record. All records are created on the same day so I cannot use sorting by CreatedOn column.

    I used FetchXML Builder to modify view definition and now it is like this:

    <fetch version="1.0" top="1" output-format="xml-platform" mapping="logical">

    When I execute this view in FetchXML Builder i get only one row in results.

    After I saved this view in CRM I tried to get records and I still see more than 5.000 records.
    The requirement is to return only one record.

    CRM version: 1612 (9.0.19.8) (DB 9.0.19.8) on-premises

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

News and Announcements

Announcing Category Subscriptions!

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,359 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,370 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans