2

How to properly check that some %ZEN.proxyObject's object has a specific property?

In my case I have %ZEN.proxyObject instance. My guess is set p = $PROPERTY(object, "propertyName"). $PROPERTY returns an empty string if property does not exists, but what if the property value is an empty string?

ZitRo
  • 1,163
  • 15
  • 24

1 Answers1

4

Use %data property of %ZEN.proxyObject:

Set obj = ##class(%ZEN.proxyObject).%New()
Set obj.a = 2
Write $Data(obj.%data("a"))
>1
Write $Data(obj.%data("b"))
>0
rfg
  • 1,331
  • 1
  • 8
  • 24