OnDMLCacheReceivedItem Event

Applies to
TIB_Dataset

Declaration
TIB_ReceiveDMLCacheItemEvent = Procedure(ADataset: TIB_Dataset; const ADMLCacheItem: TIB_DMLCacheItem ) of object;

Description
This event is used to customize how the dataset will respond to the announcement from another dataset that changes have occurred.

Here is an example of what the DefaultDMLCacheReceivedItem( ADMLCacheItem ); method does so that you can make your own customized behavior if necessary.

procedure TIB_BDataset.DefaultDMLCacheReceivedItem(
  const ADMLCacheItem: TIB_DMLCacheItem);
var
  ii: integer;
  tmpStr: string;
begin
  tmpStr := '';
  for ii := 0 to KeyFields.ColumnCount - 1 do begin
    if ii > 0 then begin
      tmpStr := tmpStr + ';';
    end;
    tmpStr := tmpStr + KeyFields[ii].FieldName;
  end;
  if AnsiCompareText( ADMLCacheItem.KeyFieldNames, tmpStr ) = 0 then begin
    KeyFields.Values[ ADMLCacheItem.KeyFieldNames ] :=
      ADMLCacheItem.KeyFieldValues;
    case ADMLCacheItem.DMLCacheItemType of
      ditEdit: InvalidateBookmark( KeyFields.RowData );
      ditDelete: DeleteBufferBookmark( KeyFields.RowData );
      ditInsert: InsertBufferBookmark( KeyFields.RowData );
    end;
  end;
end;

Please see the Survey sample application in the D4Apps folder.