Question Ming Zhou · Feb 11, 2022 How can I open an object with dynamic class name and id? Similar to: "set obj = ##class(myClass).%OpenId(id)", which give the an instance of the object with given ID, is there a way to implement a function/classmethod to return the same by providing both class name and ID as a parameter, such as: getObjectInstanceByNameId(className As %String, id As %Integer), using ObjectScript code? #Caché 1 7 0 449
Question Ming Zhou · Jan 28, 2022 Are immutable properties supported in ObjectScript classes? Can we make any property immutable once it value is set? For example, I may have a property called RecordCreatedTime to track when the record is created in IRIS, and once it is set, I don't want anyone to modify the value. #Caché 0 4 0 188
Question Ming Zhou · Jan 21, 2022 How to get all properties defined in a class from %Dictionary.ClassDefinition? I am looking for a way to find all properties defined in any given class through coding, including those inherited from parent class(s). In case of inherited properties, I would like to know from which class etc. A related question: XML adaptor provides a way to export xml schema for a class. Is there a similar method for JSON adaptor to generate a JSON schema for a class? Thanks in advance for your help. #Caché 0 5 0 277