randall debold · Oct 5, 2017 go to post

Thank you for clarifying this,

Interesting that the object to json support was removed, which is really what i was primarily looking for.

At this point I would need to create my own method, or maybe use this method:

set json=##class(%ZEN.Auxiliary.altJSONProvider).%ObjectToAET(person)

thanks again,

randall debold · Oct 6, 2017 go to post

the part about the syntax changing in versions 2016.2+,

however, the initial question, and perhaps i did not make it clear was a way to project an object (such as Samples.Person) to JSON /dynamic object.

the example in pre 2016.2 version was: 

set person=##class(Sample.Person).%OpenId(1)
write person.$toJSON()

however i have not found a "api" using dynamic objects to do the same, something like this:

set person=##class(Sample.Person).%OpenId(1)

write person.%toJSON()

other than using the %ZEN.Auxiliary.altJSONProvider methods,

which i can live with,

i could also create my own method to "walk" the class properties and build the json/dynamic object myself,

which brings me to a follow up question:

is there a way to add custom property parameters, not a class parameter but the parameters you would see in the inspector within studio for a given property: CALCSELECTIVITY, CAPTION, COLLATION, CONTENT, etc...

the idea i have would be to add parameters i can use to include/exclude various properties from code that is accessing data from the class based on user "level" or other criteria.

thanks,

randall debold · Oct 9, 2017 go to post

yep, along with those there could be others, formGroup, requiredWith, ect...

thanks,