FireDAC.Comp.DataSet.TFDDataSet.DisableConstraints

From RAD Studio API Documentation
Jump to: navigation, search

[–] Properties
Type:
procedure
function
Visibility: public
Source:
FireDAC.Comp.DataSet.pas
FireDAC.Comp.DataSet.hpp
Unit: FireDAC.Comp.DataSet
Parent: TFDDataSet

Delphi

procedure DisableConstraints;

C++

void __fastcall DisableConstraints();

Description

Disables the enforcement of the client constraints.

Use DisableConstraints to turn off an enforcement of the client constraints that are in the Constraints property (record constraints) or are assigned to the dataset fields (field constraints). 

Calling DisableConstraints increments an internal counter. As long as this reference count is greater than zero, constraints are disabled for the dataset. To prevent accidental disabling of constraints, always group a call to DisableConstraints with a call to EnableConstraints.

If the application needs to perform batch updates to the dataset, then consider using the BeginBatch / EndBatch methods.

Example

FDQuery1.DisableConstraints;
try
  // perform updates here, without checking client constraints
finally
  FDQuery1.EnableConstraints;
end;

See Also