1. Joe Hess II
  2. PowerServer 2020 or older (Obsolete)
  3. Friday, 6 December 2019 21:07 PM UTC

I'm trying to use JSONParser with PowerServer 2019, Build 2082. In the code below, ls_error is an empty string after i call LoadString. According to the documentation, LoadString should return an empty string if successful, or null if an error occurs. GetRootItem returns 0 which is not documented unless 0 is a valid pointer. 

I suspect something is (not) happening with LoadString. Any ideas? This works with PowerBuilder.

Thank you,

Joe

 

 

ip_jsonp = CREATE JSONPARSER
ls_json = '{"firstName":"Joe"}'
ls_Error = ip_jsonp.LoadString(ls_json)

IF (LEN(trim(ls_Error)) > 0) THEN
  Messagebox("Failed","Loan json failed : "+ ls_Error)
  RETURN -1
ELSEIF ( IsNull (ls_error) ) THEN
  MessageBox ( "Failed", "Load JSON Failed.")
  RETURN -1
END IF


ll_root = ip_jsonp.GetRootItem()

Kai Zhao @Appeon Accepted Answer Pending Moderation
  1. Monday, 9 December 2019 00:47 AM UTC
  2. PowerServer 2020 or older (Obsolete)
  3. # 1

Hi Joe,

Please note the JSONParser object is supported by PowerServer Web but unsupported by PowerServer Mobile. If you want to run application on web only, please make sure the project type is ‘Web’ (Toolkit > Configure > Application Profile Configuration> Basic Settings), thus the unsupported features report would only include the unsupported features by PowerServer Web (the report will include all the unsupported features by Web and Mobile if the project type is ‘Both’).

For PowerServer Mobile, please try the "eon_cjsonnode" object class located in the "Appeon_Workarounds.pbl" library. please refer to PowerServer online help for details.
https://docs.appeon.com/appeon_online_help/ps2019/workarounds_and_api_guide/ch01s03s11.html

Regards,
ZhaoKai

Comment
There are no comments made yet.
Joe Hess II Accepted Answer Pending Moderation
  1. Monday, 9 December 2019 20:17 PM UTC
  2. PowerServer 2020 or older (Obsolete)
  3. # 2

Thank you for replying.

In the code, I am checking the client type. The JSON Parser is only being used when running a web client. Just to be sure, I changed the project type to just Web, and then I redeployed the project. No errors. JSONParser is still not working.

The object is working on our server, so I'm a little lost as to why it will not work in my development environment. This machine had 2017 installed prior to 2019. I uninstalled everything related to 2017. I reinstalled the PowerServer plugin. I've tried multiple browsers.

Joe

Comment
  1. Kai Zhao @Appeon
  2. Tuesday, 10 December 2019 00:22 AM UTC
Hi Joe,



PowerServer 2019 start to support JSONParser, and you are need to use PB & Toolkit 2019 to deploy application.



Regards,

ZhaoKai
  1. Helpful
  1. Joe Hess II
  2. Tuesday, 10 December 2019 00:28 AM UTC
Yes, I know. I uninstalled all PB2017 apps .I only have 2019 installed.
  1. Helpful
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.