Hey Ashok.
I think there's a slight correction needed for your code snippet.
Specifically, for the line "do object.Organizations.GetAt(key).%DeleteId(key)" the DeleteId using the value of Key will not be the correct value to delete the intended object.
Should the code block instead be:
ClassMethod %OnDelete(oid As %ObjectIdentity) As %Status [ Private, ServerOnly = 1 ]
{
Set object = ..%Open(oid,,.status)
If $$$ISERR(status) Quit status
If $ISOBJECT(object.Organizations) {
Set org= object.OrganizationsGetSwizzled()
While org.GetNext(.key){
Set tID = object.Organizations.GetAt(key).%Id()
Do object.Organizations.GetAt(key).%DeleteId(tID)
}
}
Quit $$$OK
}- Log in to post comments

.png)
.png)
.png)
.png)
.png)
.png)
.png)