go to post Rui Figueiredo · Nov 19, 2018 After some investigation here is some code that works on v2015.2// to create a dynamic arraySET results = ##class(%ListOfDataTypes).%New() // to create a dynamic objectSET obj = ##class(%ZEN.proxyObject).%New() SET obj.name = "John doe"// add obj to the arrayresults.Insert(obj) // create dynamic response objectSET response = ##class(%ZEN.proxyObject).%New()SET response.Results = resultsWrite response.%ToJSON()---------------------------------------------{ "Results": [ { "name": "John Doe" } ]}Thanks,Rui
go to post Rui Figueiredo · Nov 19, 2018 Using %DynamicObject throws an exception at runtimeERROR #5002: Cache error: <CLASS DOES NOT EXIST>zGetED0005A+84^xxxxxxx *%Library.DynamicObject
go to post Rui Figueiredo · Aug 23, 2017 Hi Chris,Thanks for your help.I've sorted the issue using $ZSTRIP function on the ReportDefinition.<attribute name="Reaction" field="Reaction" expression='$ZSTRIP(%val,"*C")' />Regards,Rui
go to post
After some investigation here is some code that works on v2015.2
// to create a dynamic array
SET results = ##class(%ListOfDataTypes).%New()
// to create a dynamic object
SET obj = ##class(%ZEN.proxyObject).%New()
SET obj.name = "John doe"
// add obj to the array
results.Insert(obj)
// create dynamic response object
SET response = ##class(%ZEN.proxyObject).%New()
SET response.Results = results
Write response.%ToJSON()
---------------------------------------------
{
"Results": [
{
"name": "John Doe"
}
]
}
Thanks,
Rui
go to post
Using %DynamicObject throws an exception at runtime
ERROR #5002: Cache error: <CLASS DOES NOT EXIST>zGetED0005A+84^xxxxxxx *%Library.DynamicObject
go to post
Hi Chris,
Thanks for your help.
I've sorted the issue using $ZSTRIP function on the ReportDefinition.
<attribute name="Reaction" field="Reaction" expression='$ZSTRIP(%val,"*C")' />
Regards,
Rui