NEW2.03.00 · Released 9 July 2015
NEWfinPOWER Connect
Released in
2.03.00
9 July 2015
  1. Opened23 Jun
  2. Closed1 Jul
  3. Released9 Jul
Article 13055 Job J015769

Business Layer; added JSON Builder class

A new class has been added to the finPOWER Connect Business Layer to make it easy to build JSON strings.

This is found in the Runtime namespace. A code example is shown below:

  With finBL.Runtime.CreateJsonBuilder(True)
    .ObjectBegin()

    .WritePropertyString("AccountId", "L1000")

    .ArrayBegin("Payments")

    .ObjectBegin()
    .WritePropertyDate("Date", #5/1/2015#)
    .WritePropertyString("Reference", "AP")
    .WritePropertyDecimal("Value", 120) 
    .ObjectEnd()

    .ObjectBegin()
    .WritePropertyDate("Date", #6/1/2015#)
    .WritePropertyString("Reference", "DD")
    .WritePropertyDecimal("Value", 125)
    .ObjectEnd()

    .ArrayEnd("Payments")
    
    .ObjectEnd()

    finBL.DebugPrint(.ToJsonString)
  End With

This produces the following JSON string:

{ "AccountId": "L1000", "Payments": [ { "Date": "2015-05-01T00:00:00", "Reference": "AP", "Value": 120.0 }, { "Date": "2015-06-01T00:00:00", "Reference": "DD", "Value": 125.0 } ] }