Domino 9 und frühere Versionen > Entwicklung

Tochterdok löschen wenn Parent gelöscht wurde

<< < (2/2)

Axel:
Hi,

stimmt.´

Versuch's mal so:

Sub Initialize

Dim session As New NotesSession
Dim db As NotesDatabase
Dim dc As NotesDocumentCollection
Dim doc As NotesDocument
Dim parentdoc As NotesDocument
Dim parentUnid As String
Set db = session.CurrentDatabase
Set dc = db.unprocessedDocuments
Set doc = dc.GetFirstDocument()

While Not(doc Is Nothing)
    If doc.IsResponse Then
      parentUnid = doc.ParentDocumentUNID
    'Suche ob Elterndok. vorhanden
    Set parentdoc = db.GetDocumentByUNID(parentUnid)
     If parentdoc.NoteID = "" Then
          Call doc.ReplaceItemValue ( "Doc_Deleted", 1)  
          Call doc.Save(True, False)        
      End If
    End If
Set doc = dc.GetNextDocument(doc)
Wend
End Sub


Axel

MrMagoo:
Hm,
jetzt macht er es, danke  :D

Navigation

[0] Themen-Index

[*] Vorherige Sete

Zur normalen Ansicht wechseln