FireDAC.Comp.DataSet.TFDDataSet.UndoLastChange

From RAD Studio API Documentation
Jump to: navigation, search

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

Delphi

function UndoLastChange(AFollowChange: Boolean): Boolean;

C++

bool __fastcall UndoLastChange(bool AFollowChange);

Description

Undoes the last modification to the dataset records.

Use UndoLastChange to undo the last modification to the dataset records and remove the change from the dataset change log. 

The method is applicable to the datasets working when CachedUpdates is set to True

If AFollowChange is True, then the current position in the dataset is set to the restored record. Otherwise the position remains unchanged. 

To check whether the changed log is not empty, read the UpdatesPending property value. If it is True, then there are changes to undo.

Example

procedure TForm1.btnUndoClick(ASender: TObject);
begin
  FDQuery1.UndoLastChange(True);
end;

See Also