post method

void post()

Implementation

void post() {
  updateRecord();
  if (_state == TDataSetState.dsEdit || _state == TDataSetState.dsInsert) {
    dataEvent(TDataEvent.deCheckBrowseMode, 0);
    doBeforePost();
    if (!tryDoing(internalPost, onPostError)) return;
    cursorPosChanged();
    freeFieldBuffers();
    // First set the state to dsBrowse, then the Resync, to prevent
    // the calling of the deDatasetChange event, while the state is
    // still 'editable', while the db isn't (original comment kept as-is)
    setState(TDataSetState.dsBrowse);
    resync(<TResyncModeItem>{});
    doAfterPost();
  } else if (_state != TDataSetState.dsSetKey) {
    databaseErrorFmt(SNotEditing, [name], this);
  }
}