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...
Answered

Summing total qty field for all rows for a column on list page

(0) ShareShare
ReportReport
Posted on by 65

Screenshot-2022_2D00_10_2D00_07-003234.png

This is on a custom page, for a custom table. The above code is not summing every row in the table, just the row that is selected. This code is the way I envision calculating the sum for a field (outstanding qty), and displaying it in the total qty field. Again, it is just calculating the individual line that is selected though, and displaying that value in the total qty field, instead of summing up every row and calculating the outstanding qty for the entire table. 

Any ideas on this would be appreciated. If you do comment, please be specific in your suggestion. 

Thanks. 

I have the same question (0)
  • Suggested answer
    DAnny3211 Profile Picture
    11,397 on at

    Hello

    excuse me but is KPSAL the same table as the Rec of the page?

    once you calculate CalcSums with the KPSAL variable you should assign it to the rec. "total Qty."

    rec. "total Qty.":=KPSAL. "Outstanding Quantity"

    I don't know if I'm missing something or you can add some more details.

    another idea might be to create a flowfield of type Sum with the filter logic you apply in your procedure

    DAniele

  • Suggested answer
    azharsaeedkhan Profile Picture
    60 on at

    Try

    Rec."Total Qty" := KPSAL."Outstanding Quantity";

  • AGV Profile Picture
    65 on at

    Hey Danele, I tried that right after this post, and it still did not work. However, that syntax works with other tables/pages because I have done it successful on the sales line page.

    I think it is the way the custom table/page is pulling in the values. I did not create the table/page, but it should work the way you described because I have successfully done that on other pages already.

    I'll just have to use the calcsums procedure on the sales line page because it is summing up the values in the entire column just fine using that table.

    Thanks.

  • Verified answer
    AGV Profile Picture
    65 on at

    Correction, I switched the "Total Qty" field to a variable on the page when trying to resolve before switching the calculation to := KPSAL."Outstanding Quantity", which seemed to be the issue. Below code is correct:

     Screenshot-2022_2D00_10_2D00_07-045106.png

  • Verified answer
    Marco Mels Profile Picture
    on at

    Thank you for sharing final solution.

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 3,229

#2
Jainam M. Kothari Profile Picture

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

#3
YUN ZHU Profile Picture

YUN ZHU 1,153 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans