FireDAC.Phys.MongoDBDataSet.TFDMongoDataSet.AutoCalcFields

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

property AutoCalcFields;

C++

__property AutoCalcFields = {default=1};

Properties

Type Visibility Source Unit Parent
property published
FireDAC.Phys.MongoDBDataSet.pas
FireDAC.Phys.MongoDBDataSet.hpp
FireDAC.Phys.MongoDBDataSet TFDMongoDataSet

Description

Determines when the OnCalcFields event is triggered and when lookup field values are calculated.

FireDAC.Phys.MongoDBDataSet.TFDMongoDataSet.AutoCalcFields inherits from Data.DB.TDataSet.AutoCalcFields. All content below this line refers to Data.DB.TDataSet.AutoCalcFields.

Determines when the OnCalcFields event is triggered and when lookup field values are calculated.

Set AutoCalcFields to control when the OnCalcFields event is triggered to update calculated fields and when lookup fields are calculated.

A calculated field is one that derives its value from the values of one or more fields in the active record, sometimes with additional processing. Lookup fields are fields whose values come from a secondary dataset or lookup cache.

Note: Unidirectional datasets support calculated fields but not unidirectional fields. For unidirectional datasets, OnCalcFields only controls when calculated fields are updated.

When AutoCalcFields is True (the default), Lookup fields are recalculated and OnCalcFields is triggered when:

  • The dataset is opened.
  • The dataset is put into dsEdit state.
  • Focus moves from one visual control to another, or from one column to another in a data-aware grid and modifications have been made to the record.

When AutoCalcFields is False, Lookup fields are recalculated and the OnCalcFields event occurs only when:

  • The dataset is opened.
  • The dataset is put into dsEdit state.
  • A record is retrieved from a database.

If an application permits users to change data, OnCalcFields is frequently triggered. In these cases an application may set AutoCalcFields to False to reduce the frequency with which the OnCalcFields event occurs and with which lookup values are fetched.

See Also