1. Carl Bolduc
  2. .NET DataStore
  3. Tuesday, 12 September 2023 20:13 PM UTC

The new REST API support is great. We are prototyping a web application which shares an API with our PB application.

Manipulating the data when reading and saving information is very complex in JavaScript. When manipulating information coming from a DataWindow, there is a very large structure which needs to be maintained to keep the compatibility between both types of UI.

Is there an npm module to help dealing with the structure of DataStore objects?

Maybe we should stay away from JavaScript and use server side rendering in .NET instead... If some of you have had success creating web applications using the REST API, I would be very interested in your findings.

Accepted Answer
Logan Liu @Appeon Accepted Answer Pending Moderation
  1. Thursday, 14 September 2023 03:55 AM UTC
  2. .NET DataStore
  3. # Permalink

Hi Carl,

I think you can either choose DataWindow JSON or Plain JSON: Supported JSON formats - - Application Techniques (appeon.com)

Plain JSON follows the industry standard JSON format, It could be a better choice if not consume the Web API from the other front-end.

E.g.: Call the ExportPlainJson method of .NET DataStore, then the JSON in the response will be easier to parse.

DataStoreDataExtensions.ExportPlainJson Method (appeon.com)

 

If you have mixed client applications including PowerBuilder application and other front-end tech, you can also consider providing both DataWindow JSON and Plain JSON in your Web API Controller. Maybe you can try the Scaffolding feature of SnapDevelop. There are some .NET DataStore templates you can choose to create the controller quickly: Scaffolding Guide (appeon.com)

Regards, Logan

 

Comment
  1. Carl Bolduc
  2. Friday, 15 September 2023 14:03 PM UTC
Thank you, this is very helpful.
  1. Helpful
There are no comments made yet.


There are replies in this question but you are not allowed to view the replies from this question.