web
You’re offline. This is a read only version of the page.
close
Skip to main content
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

I have the same question (0)
  • Verified answer
    Mohana Yadav Profile Picture
    60,993 Super User 2025 Season 2 on at
    RE: Setrange

    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,885 on at
    RE: Setrange

    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
    RE: Setrange

    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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics NAV (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans