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

Notifications

Announcements

No record found.

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,005 Super User 2025 Season 2 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,005 Super User 2025 Season 2 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

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)

#1
HoangNam Profile Picture

HoangNam 7

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans