#1 2014-11-17 19:01:45

itSDS
Member
From: Germany
Registered: 2014-04-24
Posts: 506

TCreateTime / TModTime and CrossPlatform Object Creation

Hi AB,

i create TSQLRecord on my Mobile Device and don't Know how to set TTimeLog there. (No SynCommons.pas available sad )

Last edited by itSDS (2014-11-17 19:03:36)


Rad Studio 12.1 Santorini

Offline

#2 2014-11-17 19:16:27

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,231
Website

Re: TCreateTime / TModTime and CrossPlatform Object Creation

If you use our SynCrossPlatformRest.pas unit, both TCreateTime / TModTime fields will be automatically set before being sent to the server.
You have nothing to do.
TSQLModelInfo.ComputeFieldsBeforeWrite() will do the work for you.
In fact, SynCrossPlatformRest.pas is some kind of cross-platform SynCommons.pas + mORMot.pas - for the client part only, of course.
See http://synopse.info/files/html/api-1.18 … mREST.html
smile

You have TTimeLog functions in SynCrossPlatformRest.pas, to convert to/from a TDateTime, if you want to work with a TTimeLog field directly.
But you can also use a TDateTime for timestamp fields.

Online

#3 2014-11-17 22:39:33

itSDS
Member
From: Germany
Registered: 2014-04-24
Posts: 506

Re: TCreateTime / TModTime and CrossPlatform Object Creation

Hi AB you are right but there is a bug in the Wrapper code generating the Client Pas - Files.

The fields i defined on the Server where TCreateTime and TModTime, but the code generated by the Wrapper make them TTimeLog.
As Result the HasTimeFields in ComputeFieldsBeforeWrite is false and the Values are nil.

I modified the generated code to TCreateTime / TModTime by hand and it works !


Rad Studio 12.1 Santorini

Offline

#4 2014-11-18 00:14:37

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,231
Website

Re: TCreateTime / TModTime and CrossPlatform Object Creation

So there is a small regresssion.
Could you please create a ticket?

Thanks for the feedback!

Online

#5 2014-11-18 09:14:44

itSDS
Member
From: Germany
Registered: 2014-04-24
Posts: 506

Re: TCreateTime / TModTime and CrossPlatform Object Creation


Rad Studio 12.1 Santorini

Offline

#6 2014-11-24 13:22:57

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,231
Website

Re: TCreateTime / TModTime and CrossPlatform Object Creation

Should be fixed by http://synopse.info/fossil/info/444b4c040f

Thanks for the feedback!

Online

#7 2014-11-25 13:41:40

itSDS
Member
From: Germany
Registered: 2014-04-24
Posts: 506

Re: TCreateTime / TModTime and CrossPlatform Object Creation

Very nice smile It works !


Rad Studio 12.1 Santorini

Offline

Board footer

Powered by FluxBB