How to add custom data processing

I’m following the wiki about “Advance options for controlling data updates”.
http://wiki.remobjects.com/wiki/Advanced_options_for_controlling_data_updates_(Delphi)

But I need to add some data processing on another DataTables not part of the Master/detail hierarchy.

FROM THE WIKI:
function TBasicDAService.UpdateCustomers(const RemoteDelta: Binary): Binary;

begin
result := NIL;

try
fConnection.BeginTransaction;
try
// Initializing
Streamer.Initialize(RemoteDelta, aiRead);
[…]
// Unpacking…
[…]
Streamer.Finalize;

  // Processing...

–>> I NEED SOME ADDITIONAL DATA PROCESSING HERE
–>> LIKE UPDATING StockInventory DataTable based on the OrderDetails delta

  if orderdetailsdelta <> nil  then
    OrderDetailsProcessor.ProcessDelta(Connection, orderdetailsdelta,
                                                      [ctDelete]);
  [...]
  fConnection.CommitTransaction;
except
  fConnection.RollbackTransaction;
  raise;
end;

finally
result := Binary.Create;
[…]

Thank you,
Edrick

Hello Edrick,

You could add custom data processing in such a way, for example:

[…]

  Streamer.Finalize;
  // Processing...

–>> I NEED SOME ADDITIONAL DATA PROCESSING HERE

–>> LIKE UPDATING StockInventory DataTable based on the OrderDetails delta

  ds:= fConnection.NewDataset('UPDATE StockInventory SET Field1='+
    VarToStr(orderdetailsdelta.Changes[0].NewValueByName['Discount']) +' WHERE ...');
  ds.Execute;

  if orderdetailsdelta <> nil  then
    OrderDetailsProcessor.ProcessDelta(Connection, orderdetailsdelta,
                                                      [ctDelete]);
  [...]

Hope this helps.

Thank you! It really helps…