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.
Property Value/Return Value
Type: Boolean
If you omit this optional return value and if one of the fields
is not a SumIndexField, a run-time error occurs. If you include a
return value, you must handle any errors.
Remarks
Example
This example shows how to use the CALCSUMS
function.
|
Copy Code |
"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.
See Also