web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

Setrange

(0) ShareShare
ReportReport
Posted on by

When we apply setrange for customers. How to show from first range to last range through setrange. I tired with CustomerRec.FINDfirst  then its showing 10000 and with findlast its showing 90000. How to show from 10000 to 90000 continuously? Please help me.


CustomerRec.SETRANGE("No.",'10000','90000');
IF CustomerRec.FINDSET THEN
 MESSAGE('%1',CustomerRec."No.")
ELSE
 MESSAGE('Not Found')

Thanks

*This post is locked for comments

  • Verified answer
    Mohana Yadav Profile Picture
    61,260 Super User 2026 Season 2 on at

    you need to use REPEAT UNTIL

    CustomerRec.SETRANGE("No.",'10000','90000');

    IF CustomerRec.FINDSET THEN

     REPEAT

       MESSAGE('%1',CustomerRec."No.");

     UNTIl CustomerRec.Next = 0;

  • Suggested answer
    Binesh Profile Picture
    7,887 on at

    Hello Madhavi,

    Agree with [tag:Mohana]

    you need to use REPEAT UNTIL

    //CustomerRec.SETRANGE("No.",'10000','90000'); Instead of setrange use setfilter.

    CustomerRec.SETFILTER("No.",'%1..%2','10000','90000');

    IF CustomerRec.FINDSET THEN BEGIN

    REPEAT

      MESSAGE('%1',CustomerRec."No.");

      // Here is your all records.

    UNTIl CustomerRec.Next = 0;

    END ELSE

      MESSAGE('Not Found');

  • Community Member Profile Picture
    on at

    Thank you so much guys.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Leaderboard > 🔒一 Microsoft Dynamics NAV (Archived)

#1
Hannes Holst Profile Picture

Hannes Holst 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans