Search code examples
delphidelphi-2010datasnap

How to return a record in a DataSnap method


I wish to be able to declare a Data Snap method with the following signature

type
  TLoginInfo = record
    Username: string;
    Password: string;
    LastLogged: DateTime;
  end;

function GetLoginInfo(const UserId: Integer): TLoginInfo;

When I try to call it it says that TLoginInfo is not well known.


Solution

  • If your are using the "new" Datasnap see here:

    http://blogs.embarcadero.com/adrian/2009/08/19/json-types-for-server-methods-in-datasnap-2010/ https://blogs.embarcadero.com/json-types-for-server-methods-in-datasnap-2010/ http://www.danieleteti.it/?p=146