I need to convert an array with an unknown number of indices to a JSON string for transmission (which is why it isn't possible to iterate through it using $ORDER). Does ObjectScript provide functionality to convert an array to a JSON string?
try{
....
....
....
Set tSC = method_invocation()
If $$$ISERR(tSC) {
Quit tSC
}
....
....
....
}On compiling the above, I get an error saying "QUIT argument not allowed : 'tSC' ".
- When I replace Quit tSC with Return tSC, it compiles
- On replacing Quit tSC with Quit $$$OK, I get the error: QUIT argument not allowed : '1'
- On replacing Quit tSC with Quit, it compiles
- A 'Quit tSC' statement outside of the try-catch block does not cause a
I need to convert a JSON payload to a custom object type. Currently, I'm converting the JSON object to a %Library.DynamicObject object and need to proceed from here.
As of now, these are my options
1. Using an external library talked about in this link:
https://community.intersystems.com/post/binding-regular-cache-object-dynamicobject-and-vice-versa
Downside: Could be buggy (as admitted by the creator) + some other design concerns brought up in its the discussion thread
2.