I want to override the Get and Set methods of a class property. The class maps to a pre-existing global. The property is defined like so:
Property Invalid As %Library.Boolean;
with the property mapping to a node like ^GLOBAL(Code,"INVALID")=1
Code is a property in the same class.
The value can be 0 or 1 or the node might not exist. When it doesn't exist I want the value of the SQL field to come out as 0 (false).
I'm trying to do it so that it will be self-contained, so that nothing that references the class or uses SQL to access/update the table also won't need to be changed and the field needs to be updatable by SQL as well as retrievable.
I've tried using the Retrieval code of the storage map, but then updating the field from SQL doesn't work. And I've also tried to override the Set and Get methods as follows:
Method InvalidGet() As %Library.Boolean
//I've tried both of the below lines
I +$G(^GLOBAL(..Code,"INVALID")) Quit 1
I +$G(^GLOBAL(i%Code,"INVALID")) Quit 1
Method InvalidSet(value As %Library.Boolean) As %Status
but it doesn't seem to be even running the code. I've cleared cached queries to make sure it's picking up the changes and I'm still getting blank fields when doing an SQL on the table.
The documentation page I've looked at is entitled Using and Overriding property methods.
Anyone got any ideas how to get it to work or why it isn't working?