void __fastcall UpdateConstraints();
Update the changes to the client constraints.
Use the UpdateConstraints method to update the changes to the constraints made after the dataset was activated.
The client constraints that are in the Constraints property (record constraints) or are assigned to the dataset fields (field constraints) are automatically updated when an Open call is made. The constraint changes for an active dataset are not updated automatically.
with FDQuery1.FieldByName('age') do begin CustomConstraint := 'age >= 18'; ConstraintErrorMessage := 'The age must be greater than or equal to 18 years'; end; FDQuery1.UpdateConstraints;