
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:
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.
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;