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

Community site session details

Session Id :
Small and medium business | Business Central, N...
Unanswered

API that includes a functionality to calculate sums based on data

(1) ShareShare
ReportReport
Posted on by 10

I am currently developing an API that includes a functionality to calculate sums based on data from the database. However, I am encountering challenges in integrating the sum calculation correctly within my query. Despite my attempts, I have been unable to achieve the desired result.

 

I would appreciate any guidance or suggestions on how to effectively incorporate this summation logic into my API. Are there recommended best practices for implementing this within the query, or should I consider calculating the sums in a different way, such as post-processing in the application layer?

I have the same question (0)
  • Suggested answer
    Sahan Hasitha Profile Picture
    1,374 on at
    API that includes a functionality to calculate sums based on data
    hi
     
    You can try Page type API 
  • Suggested answer
    Rishabh Kanaskar Profile Picture
    988 on at
    API that includes a functionality to calculate sums based on data
    Hi,
     
    > If possible, use AL Query objects with Sum data items to calculate totals directly at the database level, this is the most efficient approach.
    >If your logic is complex or requires conditional aggregation, consider retrieving the raw dataset and performing the sum in AL code before returning it through the API.
    > Avoid summing row-by-row in the application layer unless necessary, as it increases processing time.
     
    Thanks
    Rishabh

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…

Andrés Arias – Community Spotlight

We are honored to recognize Andrés Arias as our Community Spotlight honoree for…

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

#1
Sumit Singh Profile Picture

Sumit Singh 3,165

#2
Sohail Ahmed Profile Picture

Sohail Ahmed 2,682 Super User 2025 Season 2

#3
Nimsara Jayathilaka. Profile Picture

Nimsara Jayathilaka. 2,299

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans