By the looks of it, the original question applied $DATA to an element of the %DynamicAbstractObject classes. The $DATA and $GET functions can only be applied to Multidimensional variables. All ObjectScript local and global variables are Multidimensional. By default a property variable of a class object is not multidimensional unless the property default is over ridden with the [ Multidimensional ] attribute. The %DynamicAbstractObject classes provide no way of supporting elements which are Multidimensional. If dynobj is an object reference to a %DynamicObject then dynobj.%Get(key) is defined for all possible string values of 'key'. If dynobj.%GetTypeOf(key) returns "unassigned", or "null", then dynobj.%Get(key) will return the empty string value.
Currently, $DATA(dynobj.keyname) signals <PROPERTY DOES NOT EXIST> which is what is signaled for by all classes if the Property 'keyname' does not exist. In a future IRIS release it will report
<INVALID CLASS> *Class '%Library.DynamicObject' does not support MultiDimensional operations
The correct way to see if keyname "test" exists in a %DynamicObject is to evaluate (dynobj.%GetTypeOf("test") '= "undefined") .
- Log in to post comments