CancelPost
procedure CancelPost;
Example
procedure AbandonPendingChange(const View: TdaSQLQueryDataView);
begin
View.CancelPost;
end;
Usage
CancelPost cancels the current pending edit or insert in the data view's client dataset without undoing records already posted or persisted.
- Call this in the exception path that owns the current pending edit.
- Do not use it as a database transaction rollback; transaction control belongs to the surrounding Velox connection/action flow.
- After a successful cancel, re-read fields because the active record buffer may have been restored or repositioned.
Additional Technical Info
CancelPost is declared by hidden TdaQueryDataView and used through a concrete view such as TdaSQLQueryDataView or TdaCDSQueryDataView.
Source-backed behaviour
The hidden base implementation is an intentional no-op because the PascalScript importer cannot bind an abstract method. Both shipped visible descendants override it with FQuery.Cancel, where FQuery is a TvxClientDataSet. Delphi TDataSet.Cancel abandons only the current dsEdit or dsInsert buffer and returns the dataset to browse state; calling it outside an active edit is harmless descendant behaviour.
It does not restore records already posted, reverse Delete/DeleteAll, reopen a query, or roll back SQL previously executed by the DataView save workflow. Field/event/provider exceptions raised while cancelling propagate according to the dataset.