HiI need to update accumulators on the parent when deleting a child. I’ve tried to call the code below (residing in the script library) from querydocumentdelete. However it seems that “respdoc.isdeleted” is not working, i.e. the respdoc is not marked as deleted…
Any help would be appreciated.
Sub updateMainActivity (db As NotesDatabase, doc As NotesDocument)
Dim session As New notessession
Dim madoc As notesdocument
Dim respdoc As notesdocument
Dim collection As notesdocumentcollection
'Get parent document (MainActivity)
parentUNID = doc.ParentDocumentUNID
Set madoc = db.GetDocumentByUNID(parentUNID)
'Set defaultdata from children
...
Set collection = madoc.Responses
If Not collection Is Nothing Then
'** Get data from Activity **
For count = 1 To collection.count
Set respdoc = collection.GetNthDocument(count)
If Not (respdoc.IsDeleted) Then
If respdoc.Form(0) = "Activity" Then
... accumulate child values
End If
End If
Next
'************** Update MainActivity *********************
....update accumulators on parent doc
Call madoc.Save(True,False)
End If
End Sub