Published on InterSystems Developer Community (https://community.intersystems.com)

Home > After saving swizzled objects, is it possible to open a direct ref and verify saved data without closing the original parent.

Question
Alex Kogan · Mar 5, 2021

After saving swizzled objects, is it possible to open a direct ref and verify saved data without closing the original parent.

I have a quick question regarding swizzled objects.

I have an original object, say Object a, I am working with.

I set a property a.something.somethingother.somethingelse.myNewProperty  to some value x.

Then at some point I am saving a and continuing to work with it.  I assume here by saving a, I saved myNewProperty as well. (as it should work)

At some point  I would like to make certain that I have correct value in my myNewProperty, so since I happen to know it's ID I 
open it directly:
Set ref=##class(somethingelse).%OpenId(Id)
but when I try to look at my ref.myNewProperty it seem to be displaying the value of a.something.somethingother.somethingelse.myNewProperty 
and not value of ref.myNewProperty.    

I am not certain if there is an answer, but would like to know if it is possible or that it is not possible without closing my parent ref a.

Thank you

#ObjectScript #InterSystems IRIS
Product version: IRIS 2020.1

Source URL:https://community.intersystems.com/post/after-saving-swizzled-objects-it-possible-open-direct-ref-and-verify-saved-data-without-closing