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

Put a limit on "CalcFormula = Sum ..."

(0) ShareShare
ReportReport
Posted on by 92

On the "Bank Account Ledger Entries" page, I need to create a "Balance" field, which will depend directly on the "Amount" field of each line. Basically, the formula to calculate the "Balance" field would be "Balance = Balance + Amount", so "Balance" would change in each line, as the amounts accumulate.

In the "Bank Account List" page there is a "Balance" field, which is calculated in the "Bank Account" table, in this way:

pastedimage1637705945060v1.png

pastedimage1637705974187v2.png

I need to do exactly that on the "Bank Account Ledger Entries" page, but for each line, that is, add all the "Amount" fields but only up to the date of each line.

Is there a way to limit "CalcFormula = Sum" so that it only sums up to the current line?

I am also open to other alternatives to achieve this, I am lost.

  • Suggested answer
    IB-29041624-0 Profile Picture
    1,191 Moderator on at

    You can use datefilter to get the sum for a spesific date or a set of dates. Here is an example from the customer table. But the date filter field is also avalible on the bank account table.

    var

       CustomerRec: Record Customer;

    begin

       CustomerRec.SetRange("Date Filter",20080101D,20081231D);  

       CustomerRec.CalcFields(Balance, "Net Change");  

    end;

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 728 Super User 2026 Season 2

#2
YUN ZHU Profile Picture

YUN ZHU 545 Super User 2026 Season 2

#3
AndrewThomas81 Profile Picture

AndrewThomas81 328 Super User 2026 Season 2

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans