Recent posts:
Recent replies:

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

Using %DynamicObject throws an exception at runtime

ERROR #5002: Cache error: <CLASS DOES NOT EXIST>zGetED0005A+84^xxxxxxx *%Library.DynamicObject

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

Followers:
Rui has no followers yet.
Following:
Rui has not followed anybody yet.
Global Masters badges:
Rui has no Global Masters badges yet.