- vignesh ramkumar
- PowerBuilder
- Wednesday, 7 April 2021 06:14 AM UTC
Hi Gurus,
We have migrated the PB from 2017 r3 to 2019 r3. We have a Json string building function which is working fine in 2017 where as its not building the expected array string in 2019. Following is the code
Jsongenerator jga
jga = create JSONGenerator
ll_jsonarray = jga.CreateJsonArray()
ll_child = jga.AddItemobject(ll_jsonarray)
jga.AddItemString(ll_child,"paramName", "ai_acct_id")
jga.AddItemnumber(ll_child,"paramvalue", ai_acct_id)
jga.AddItemString(ll_child,"paramName", "ai_acct_owner")
jga.AddItemnumber(ll_child,"paramvalue", ai_acct_owner)
jga.AddItemString(ll_child,"paramName", "ai_cust_id")
jga.AddItemnumber(ll_child,"paramvalue", ai_cust_id)
jga.AddItemString(ll_child,"paramName", "ai_cust_owner")
jga.AddItemnumber(ll_child,"paramvalue", ai_cust_owner)
jga.AddItemString(ll_child,"paramName", "as_branchid")
jga.AddItemnumber(ll_child,"paramvalue", ll_branch_id)
jga.AddItemString(ll_child,"paramName", "as_state")
jga.AddItemString(ll_child,"paramvalue", ls_state)
jga.AddItemString(ll_child,"paramName", "as_country")
jga.AddItemString(ll_child,"paramvalue", ls_country)
jga.AddItemString(ll_child,"paramName", "as_version")
jga.AddItemString(ll_child,"paramvalue", "APP")
ls_json1 = jga.getjsonstring( )
Expected result string:
[{"paramName":"ai_acct_id","paramvalue":1111,
"paramName":"ai_acct_owner","paramvalue":111,
"paramName":"ai_cust_id","paramvalue":1111,
"paramName":"ai_cust_owner","paramvalue":111,
"paramName":"as_branchid","paramvalue":111,
"paramName":"as_state","paramvalue":"AA",
"paramName":"as_country","paramvalue":"bbb",
"paramName":"as_version","paramvalue":""}]
What we got in 2019:
[{"paramName":"as_version","paramvalue":""}]
Am i missing anything here?.
Thanks
Vignesh
Find Questions by Tag
Helpful?
If a reply or comment is helpful for you, please don’t hesitate to click the Helpful button. This action is further confirmation of their invaluable contribution to the Appeon Community.