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)

What does SETRANGE fucntion does in C/AL code?

(0) ShareShare
ReportReport
Posted on by 12

What does SETRANGE function does in the object?

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Mohana Yadav Profile Picture
    61,204 Super User 2026 Season 1 on at

    can you be more clear please?

  • Sulav Thapaliya Profile Picture
    12 on at

    what is the use of setrange function?

    At what condition do u use this function?

  • Verified answer
    keoma Profile Picture
    32,729 on at

    the setrange function is a record function used in c/al to filter records.

    e.g. lets say you declare variable CustRec with datatype record and subtype Customer.

    CustRec.SETRANGE("No.", '100'); filters all records of table customer to that one record, which has in field No. value 100. after that command you'll need a find function to activate that filter like CustRec.FindFirst.

    for further details follow

    msdn.microsoft.com/.../dd355053(v=nav.70).aspx

    msdn.microsoft.com/.../dd338835(v=nav.70).aspx

  • Verified answer
    Mohana Yadav Profile Picture
    61,204 Super User 2026 Season 1 on at

    Please read this Microsoft help

    msdn.microsoft.com/.../dd355053.aspx

    Please contact in your office for the training.

  • mmv Profile Picture
    11,471 on at

    Hi,

    In simple terms, it's used for filtering the data. 

    SETRANGE("Posting Date",01012015D,31012015D) will filter all the records in this date range.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > 🔒一 Microsoft Dynamics NAV (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans