Show/Hide Toolbars

TMS XData Documentation

Navigation: TXDataClient

Creating Entities

Scroll Prev Top Next More

Use TXDataClient.Post to create a new object in the server.

 

C := TCountry.Create;
try
  C.Name := 'Germany';
  Client.Post(C);
finally
  C.Free;
end;

 

Pay attention to client memory management to learn which objects you need to manually destroy. In this case, the client won't destroy the TCountry object automatically so you need to destroy it yourself.

The client makes sure that after a successful Post call, the Id of the object is properly set (if generated by the server).