Stéphane Wierzbicki 45 Posted January 26, 2019 Hello I would like to serialize a FieldDefs list.The idea is to let my user update a TFDMemTable fields list and save this list. I tried to use the TJSON class (found in unit REST.JSON), for example, TJSON.ObjectToJsonString (FDMemTable1.FieldDefs); This code fails with an stack overflow error (unit system, function UnicodeFromLocaleChars). Do I have to build all this list from the scratch ? Btw, I'm using Delphi RIO 10.3 Share this post Link to post
Eli M. 38 Posted January 28, 2019 It has built in support to save out to JSON. https://flixengineering.com/archives/299 Share this post Link to post
Stéphane Wierzbicki 45 Posted January 30, 2019 On 1/28/2019 at 2:13 PM, Eli M. said: It has built in support to save out to JSON. https://flixengineering.com/archives/299 It only save the content of the Dataset, not it's definition. Share this post Link to post
Eli M. 38 Posted February 6, 2019 Looks like it saves the definition to me? {"FDBS":{"Version":15,"Manager":{"UpdatesRegistry":true,"TableList":[{"class":"Table","Name":"FDQueryTenants","SourceName":"tenants","SourceID":1,"TabID":0,"EnforceConstraints":false,"MinimumCapacity":50,"ColumnList":[{"class":"Column","Name":"TENANTID","SourceName":"TENANTID","SourceID":1,"DataType":"WideString","Size":144,"Searchable":true,"FixedLen":true,"Base":true,"OInUpdate":true,"OInWhere":true,"OriginTabName":"TENANTS","OriginColName":"TENANTID","SourceSize":144},{"class":"Column","Name":"TENANTNAME","SourceName":"TENANTNAME","SourceID":2,"DataType":"WideString","Size":256,"Searchable":true,"Base":true,"OInUpdate":true,"OInWhere":true,"OriginTabName":"TENANTS","OriginColName":"TENANTNAME","SourceSize":256}],"ConstraintList":[],"ViewList":[],"RowList":[{"RowID":0,"Original":{"TENANTID":"00000000-0000-0000-0000-000000000001","TENANTNAME":"Initial tenant"}}]}],"RelationList":[],"UpdatesJournal":{"Changes":[]}}}} Share this post Link to post
Stéphane Wierzbicki 45 Posted February 6, 2019 Well, looks like you need to insert at least one record to get all the details. I've tried to only populate the field list without any data... Will look at this again. Thank Share this post Link to post