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...
Suggested Answer

Al Languauge Query-

(1) ShareShare
ReportReport
Posted on by 319
Dears.
 
I am writing API query object i want to get sum of Quanity and Sales Line Total from Sales Archive table for last version number only.
 
.Lets say i have 3 Version..i Need last record. Sum(Quantity) + Sum(Total Lines Amount) 
 
I tried with sum and Max method..but not working.
any suggestions. plz.
 
Thanks in Advance.
Aqeel. 
  • Suggested answer
    YUN ZHU Profile Picture
    104,157 Super User 2026 Season 2 on at
    Hi, try adding two levels of DataItem (same table), using the Max method at the root level to collect lines, and then using Sum method in the child DataItem to get the total amount.
    Sorry the example is not exactly the same, it is somewhat similar to the following.
     
    Hope this can give you some hints.
    Thanks.
    ZHU
  • aqeel2020uae Profile Picture
    319 on at
    Dear 
    Thanks a lot for your help.
    But where i can use filter for document number its givng me max of lines table not for same docuemnt.

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

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 570 Super User 2026 Season 2

#2
YUN ZHU Profile Picture

YUN ZHU 390 Super User 2026 Season 2

#3
Teagen Boll Profile Picture

Teagen Boll 220 Super User 2026 Season 2

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans