Hi,
I have a req to create a couple new fields on the "Bank Account List" page.
one field is Selected Payments. For this , i used a Calcformula to tally all the payments made using each bank account.
This works, here's my code
tableextension 50125 BankAccountTableExtension extends "Bank Account"
{
fields
{
field(50001; "Selected Payments"; Decimal)
{
Caption = 'Selected Payments';
AutoFormatType = 1;
CalcFormula = Sum("Gen. Journal Line".Amount WHERE("Bal. Account No." = FIELD("No.")));
Editable = false;
FieldClass = FlowField;
}
}
}
I have to create another field called "Projected Balance"
This would be the Bank Account balance - Selected Payments
However, i can't seem to find anything online that would help with a "minus" function
This is what i have so far - it may be very wrong - but this is the first set of code i've written using AL.
Any assistance would be greatly appreciated.
tableextension 50126 ProjectedBalance extends "Bank Account"
{
fields
{
field(50126; "Projected Balance"; Decimal)
{
Caption = 'Projected Balance';
}
}
procedure GetProjectedBalance(var "Selected Payments": Decimal; var "Projected Balance": Decimal)
begin
CalcFields(Balance);
"Selected Payments" := "Selected Payments";
"Projected Balance" := Balance - "Selected Payments";
end;
}