Web Connection
JSON 2 VFP
Hopefully this thread is helpful: https://support.west-wind.com/Thread62V0KEMCL.wwt
OK, thanks. I read it ...
Vincent:
wwJsonSerializer::DeserializeCursor()
You have to provide an existing cursor in order to DeserializeCursor()
.
+++ Rick ---
Thanks Rick,
But I get: Property LOCOLLECTION is not found
Here is my code:
loSer = CREATEOBJECT("wwJsonSerializer")
loCusts = loSer.DeserializeJson(FILETOSTR(GETFILE()))
CREATE CURSOR CTest (Nom C(200), Crcpen C(6))
? collectionToCursor(loCusts, "CTest")
Not sure this works for me:
DO wwJsonSerializer
SELECT * FROM customers INTO CURSOR TQuery
loSer = CREATEOBJECT("wwJsonSerializer")
lcJson = loSer.Serialize("cursor:TQuery",.t.)
*** Create empty cursor
SELECT FirstName, LastName, Company, BillRate FROM Customers ;
WHERE .F. ;
INTO CURSOR TCustomers READWRITE
*** Manual Cursor Deserialzation
loCustomers = loSer.Deserialize(lcJson) && collection
CollectionToCursor(loCustomers, "TCustomers")
*** Or built-in Deserialization
* loSer.DeserializeCursor(lcJson,"TCustomers")
BROWSE nowait