Skip to main content

Notifications

Announcements

No record found.

Small and medium business | Business Central, N...
Answered

TopNumberOfRows not restricting data

(1) ShareShare
ReportReport
Posted on by 5

Hi

I have a simple query using 'TopNumberOfRows, but it doesnt seem to restrict the data, can anyone spot where I am going wrong?

pastedimage1675094818656v2.png

  • Carsten W. Profile Picture
    Carsten W. 5 on at
    RE: TopNumberOfRows not restricting data

    I have the same problem.

    With Business Central OnPrem Version

    DE Business Central 20.0 (Platform 20.0.37114.38150 + Application 20.0.37253.38230)

    data is not limited.

    If I run the same code on Cloud Version:

    DE Business Central 22.0 (Plattform 22.0.56306.0 + Anwendung 22.0.54157.54644)

    data is limited as expected.

    So it could be a bug.

    Any suggestions what to do know?

  • CD MILHO Profile Picture
    CD MILHO 5 on at
    RE: TopNumberOfRows not restricting data

    Thanks, I tested the example you gave and it is also problematic so presumably a bug.

  • CD MILHO Profile Picture
    CD MILHO 5 on at
    RE: TopNumberOfRows not restricting data

    Thanks, I copied the example in the attached link except for the ID and the number of rows which I lowered to 2 but it returned all the data

  • Verified answer
    YUN ZHU Profile Picture
    YUN ZHU 74,115 Super User 2024 Season 2 on at
    RE: TopNumberOfRows not restricting data

    Hi, I just tested it and there is indeed a problem.

    pastedimage1675125849281v1.png

    pastedimage1675125893288v2.png

    Have you tested the standard Query below? I suspect it's a standard bug if this is also problematic.

    pastedimage1675125918986v3.png

    Hope this helps.

    Thanks.

    ZHU

  • Suggested answer
    Inge M. Bruvik Profile Picture
    Inge M. Bruvik 32,748 Super User 2024 Season 1 on at
    RE: TopNumberOfRows not restricting data

    I think you are missing the new rows parameter as it is documented here:

    learn.microsoft.com/.../queryinstance-topnumberofrows-method

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

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,391 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,445 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans