Skip to main content

AppendRecord

procedure AppendRecord(const Values: array of const);

Example

procedure AddSimpleRecord(const Data: TvxClientDataSet);
begin
Data.AppendRecord(['A100', 'Ready', 3]);
end;

Usage

AppendRecord appends a record from an array of values mapped by current field order and posts it before returning.

  • Use only when field order is stable and explicitly known; schema changes can silently remap business values.
  • Do not call Post afterward—the record has already been posted.
  • The method is not a server transaction. On TvxClientDataSet, it normally changes the in-memory client dataset; persistence depends on separate edit/apply workflow.

Additional Technical Info

AppendRecord is declared by hidden ancestor TDataSet and is normally used through a visible descendant such as TvxClientDataSet. Unlike Append, it returns in browse state and does not require a later Post.

Source-backed behaviour

The base AddRecord(..., True) path performs insert checks/events, disables controls, initializes a buffer, enters temporary insert state, runs new-record and after-insert callbacks, assigns each supplied value to Fields[I], calls before-post, and invokes descendant InternalAddRecord with append semantics. It frees field buffers, restores browse state, resynchronizes and invokes after-post before re-enabling controls.

Values are positional, not named. Fewer values leave remaining fields at defaults/null; more values than available fields raise. The operation may convert Variants through individual field types.

InsertRecord uses non-append placement. Fields exposes the positional order.

Official RTL references

Created 2026-07-15