# Record.CalcFields(Any [, Any,...]) Method
> Version: _Available or changed with runtime version 1.0._
Calculates the FlowFields in a record. You specify which fields to calculate by using parameters.
## Syntax
```al
[Ok := ]  Record.CalcFields(Field1: Any [, Field2: Any,...])
```
## Parameters
Record
Type: record-data-type
An instance of the record-data-type data type.
Field1
Type: ../any/any-data-type
*[Optional] Field2*
Type: ../any/any-data-type
## Return Value
*[Optional] Ok*
Type: ../boolean/boolean-data-type
true if the operation was successful; otherwise false. If you omit this optional return value and the operation does not execute successfully, a runtime error will occur.
## Remarks
FlowFields are virtual fields. The values in these fields are not saved in the table. This means that you must use either the CalcFields method or the record-setautocalcfields-method to update them. For example, if you retrieve a record using the record-find-method and record-next-method, the FlowFields in those records are set to zero \(0\). Then, when you call CalcFields, their values are updated.
When a FlowField is a direct source expression on a page or a report, the calculation is performed automatically.
You can also use the CalcFields method to retrieve binary large objects \(BLOBs\). See ../blob/blob-data-type.
Dynamics 365 Business Central automatically maintains a count for all SIFT indexes. Therefore, SumIndexField Technology (SIFT) is used by default when the calculation method for a FlowField is Count or Average.
You can prevent the SIFT indexes from being updated by setting the ../../properties/devenv-maintainsiftindex-property of the index in the base table to False. Then Business Central will traverse all records in the base table to perform the calculation instead of using SIFT. This can reduce the number of required SIFT indexes, which can improve performance. See ../../devenv-sift-performance.
In Dynamics 365 Business Central, an index is not required to support a certain sorting, but sorting without an index could lead to bad performance if a search returns a large result set, which would then have to be sorted before the first row is returned.
## Example
This example shows how to use the CalcFields method to find the balance on December 31, 2008 and the net change for a customer in 2008.
```al
var
    CustomerRec: Record Customer;
begin
    CustomerRec.SetRange("Date Filter",20080101D,20081231D);
    CustomerRec.CalcFields(Balance, "Net Change");
end;
```
The first line sets up a filter for the Date Filter field in the Customer record. This field is a FlowFilter field which is used in the filter definition for several FlowFields in the Customer record. In the second line, the FlowFields are calculated.
## Related information
record-data-type
Get Started with AL<../../devenv-get-started>
Developing Extensions<../../devenv-dev-overview>
../../../administration/optimize-sql-al-database-methods-and-performance-on-server

Copyright (c) Microsoft Corporation. CC BY 4.0, https://creativecommons.org/licenses/by/4.0/; code samples MIT. From https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/methods-auto/record/record-calcfields-method, MicrosoftDocs/dynamics365smb-devitpro-pb at 828b6ee (2026-11-19). Changed: includes filled in, links to this site, and for agents shortened without dropping a fact. https://jonas-paprotka.de/docs/dev-itpro/developer/methods-auto/record/record-calcfields-method/
