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

How filter sales order only the last version no

(0) ShareShare
ReportReport
Posted on by 371
Hi community,
 
Do you know how i can filter archive sales orders only the last version?
 
 
I try to show in my cue, but still brings all version
 
 
If you know how, i will appreciate it. 
I have the same question (0)
  • Suggested answer
    YUN ZHU Profile Picture
    95,597 Super User 2025 Season 2 on at
    Hi, is it possible to try getting the final version number first and then filtering with it?
    For example,
    FieldRef.GetRangeMax() Method
     
    Record.GetRangeMax(Any) Method
     
     
    Hope this helps.
    Thanks.
    ZHU
  • Suggested answer
    Teddy Herryanto (That NAV Guy) Profile Picture
    14,284 Super User 2025 Season 2 on at
    You need to loop through each order no, get the latest version, and use that version to filter on it.
     
    Example on how to get the latest version.
     
    SalesHeaderArchive.SetRange("Document Type", DocType);
    SalesHeaderArchive.SetRange("No.", DocNo);
    SalesHeaderArchive.SetRange("Doc. No. Occurrence", DocNoOccurrence);
    SalesHeaderArchive.FindLast();
    exit(SalesHeaderArchive."Version No.");

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 > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,785

#2
Jainam M. Kothari Profile Picture

Jainam M. Kothari 1,007 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 948 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans