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 :
Small and medium business | Business Central, N...
Answered

I need to know how can we use setrange , and findset().

(0) ShareShare
ReportReport
Posted on by 65

I need to know how can we use setrange , the differnce between DocAtt("No.",rec."No.");  see over here inside the bracket we are using the same fields ,whereas over here we are mapping 2 tables like this ItmCharPch.SetRange("Document No.",  PurchOrderLine."Document No");

i need to know the differnce?

One more doubt which i have is findset what happens when we give untill   SOHeader.Next() 0;

if SOHeader.FindSet() then 
                repeat
             
  until SOHeader.Next() = 0;

  • Suggested answer
    JAngle Profile Picture
    159 on at

    Context dependent. DocAttach one you are referring to the current record with “rec.”. The DocAttach table just happens to have a generic field name that exists in a lot of places in the database.

    The second example is using a variable. So not the current record the user is accessing. It will be whatever record or set of records you determine for that instance of the table in the database. Both cases are legitimate.

    The repeat until next()= 0; will loop through all records/values found/in the variable used. So if ten records are found it counts down from 10 on each loop. Once it is 0 the loop stops.

  • Verified answer
    ALICE THOMAS Profile Picture
    65 on at

    Really appreciate your timely response and also thanks sharing the info !! now its understood.

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

Congratulations to the August Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 796 Super User 2026 Season 2

#2
YUN ZHU Profile Picture

YUN ZHU 481 Super User 2026 Season 2

#3
AndrewThomas81 Profile Picture

AndrewThomas81 377 Super User 2026 Season 2

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans