#1 2015-07-21 15:25:55

esmondb
Member
From: London
Registered: 2010-07-20
Posts: 299

TSQLRecord.Validate

I'm using TSQLRecord.Validate in a service. Would it be possible to change it to return rawUTF8 instead of string?

Also what's the best way to override the resourcestrings in SynCommons.pas?

Many thanks

Offline

#2 2015-07-21 16:03:46

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

Re: TSQLRecord.Validate

Use StringToUTF8() to get a RawUTF8 content.

See https://github.com/synopse/mORMot/blob/ … oti18n.pas for on-the-fly interception of resourcestrings.
See also LoadResStringTranslate() as defined in SynCommons.pas.

Online

#3 2015-07-21 16:39:46

esmondb
Member
From: London
Registered: 2010-07-20
Posts: 299

Re: TSQLRecord.Validate

thought of using StringToUTF8() but was thinking it would be more efficient to do the function on the client with UTF8ToString() instead of the server.

I'll have a look at LoadResStringTranslate().

Thanks

Offline

#4 2015-07-21 21:27:38

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

Re: TSQLRecord.Validate

AFAIR validation should be done on the client side, at UI level.

Online

#5 2015-07-25 10:23:12

esmondb
Member
From: London
Registered: 2010-07-20
Posts: 299

Re: TSQLRecord.Validate

Thanks, understand it better now and all works. I was doing validation server side as I was using ajax and checking for a unique field.

Offline

Board footer

Powered by FluxBB