CALCSUMS Function (Record)
Microsoft Dynamics Nav 2009
Calculates the total of a column of SumIndexFields in a C/SIDE table. Using parameters, you can specify which fields to calculate.
[Ok :=] Record.CALCSUMS (Field1, [Field2],...)
Parameters
- Record
-
Type: Record
The record that contains the SumIndexFields that you want to calculate.
- Field1, Field2, …
-
Type: Decimal
The fields that you want to calculate. Each field is a decimal field, defined as a SumIndexField, in the current key.
This example shows how to use the CALCSUMS function.
"Cust. Ledger Entry".SETCURRENTKEY("Customer No.","Date");
"Cust. Ledger Entry".SETRANGE("Customer No.", 'AAA 1050');
"Cust. Ledger Entry".SETRANGE("Date", 010196D, 123196D);
"Cust. Ledger Entry".CALCSUMS("Amount");
The first line selects a key. The second and third lines set filters for the fields Customer No. and Date in the Cust. Ledger Entry record so the total is only calculated within the specified range. The CALCSUMS function then finds the net change in account AAA 1050 for 1996. The Amount field will show the result of the calculation.
Community Additions
ADD
Show: