FireDAC.Comp.DataSet.TFDDataSet.UndoLastChange

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

function UndoLastChange(AFollowChange: Boolean): Boolean;

C++

bool __fastcall UndoLastChange(bool AFollowChange);

Properties

Type Visibility Source Unit Parent
function public
FireDAC.Comp.DataSet.pas
FireDAC.Comp.DataSet.hpp
FireDAC.Comp.DataSet TFDDataSet

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