Skip to content

Commit 58df156

Browse files
committed
Add delete handling for property object references in Message class
1 parent 2a44d99 commit 58df156

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/iop/cls/IOP/Message.cls

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -681,6 +681,24 @@ Method %ShowContents(pZenOutput As %Boolean = 0)
681681
&html<<script>$(function() {$('#element').jsonView(makeCompleteJSON(#(jsonObject)#,false));});</script>>
682682
}
683683

684+
ClassMethod %OnDelete(oid As %ObjectIdentity) As %Status [ Private ]
685+
{
686+
// Delete the property object references.
687+
Set tSC = $$$OK
688+
// Kill the global references in ^Ens.MessageBodyD(oid) and all its sub-nodes
689+
Do ##class(Ens.MessageBody).%DeleteId(oid,.tSC)
690+
Quit tSC
691+
}
692+
693+
/// Callback/Trigger for SQL delete
694+
Trigger OnDelete [ Event = DELETE ]
695+
{
696+
// Delete the property object references. {%%ID} holds the id of the record being deleted.
697+
Set tID={%%ID}
698+
Do ##class(Ens.MessageBody).%DeleteId(tID,.tSC)
699+
Quit
700+
}
701+
684702
Storage Default
685703
{
686704
<Data name="MessageDefaultData">

0 commit comments

Comments
 (0)