[Progress Communities] [Progress OpenEdge ABL] Forum Post: RE: POST JSON

Status
Not open for further replies.
G

goo

Guest
I would have done what Stefan showed you. If this is what you want: { · version : "3.1.0" , · sync-datetime : "2019-11-06 09:23:48" , · message : "" , · messages : [ ], · error : false , · invoices : [ o { § id_customer : "26518" , § id_ow : "97" , § nr_customer : "C101" , § company : "Cliente 2" , § rows : [ § { § id_invoice_details : "24399" , § id_invoice : "12859" , § description : "Riga libera" , § total : 20 }, § { § id_invoice_details : "24391" , § id_invoice : "12859" , § description : "Riga libera" , § total : 20 } ] o } ] } Then you would have something like this: HeaderInfo Invoices Rows Invoices Rows So you have HeaderInfo:JsonObject Invoices:jsonArray Invoice:jsonObject Rows:jsonArray Row:jsonObject oHeaderInfo = new jsonObject(). oHeaderInfo:Add(….) all needed fields. oInvoices = new ….jsonArray(). So for each Invoices you will: oInvoices:Add(addInvoice()). end loop. oHeaderInfo:Add(‘Invoices’,oInvoices) You should now have your json object with all the stuff you need………. Good luck PS! You have to do the same for messages …. addInvoice returns jsonObject (): oInvoice = new jsonObject(). oInvoice:Add(….). for all fields within invoicetable. oRows = new jsonArray(). Loop trough rows of invoice: oRows:Add(addRows()). end. oInvoice:Add(‘Rows’,oRows). End loop. addRows returns jsonObject: oRow = new jsonObject(). oRow:Add(…) for all fields within row. end.

Continue reading...
 
Status
Not open for further replies.
Top