Genau - mehr oder weniger
Das aktuelle Dokument (auf dem das Save aufgerufen wurde) bekommst Du über:
Set session = New NotesSession
Set db = session.CurrentDatabase
Set cdoc = session.DocumentContext
Grüße David
Es kommt keine Meldung auf der Konsole...
Hier nochmal der Agent:
Sub Initialize
Msgbox "Hallo"
Dim parentUnid As String
Dim db As NotesDatabase
Dim Parent As NotesDocument
Dim collection As NotesDocumentCollection
Dim currentResponse As NotesDocument
Dim session As NotesSession
Dim item As NotesItem
Dim doc As NotesDocument
Dim view As NotesView
Set session = New NotesSession
Set db = session.CurrentDatabase
Msgbox 1
Set view = db.GetView("VWDevices")
Set doc = session.DocumentContext
Set parent = db.GetDocumentByUNID ( doc.ParentDocumentUNID )
Set collection = parent.Responses
Msgbox 2
Set currentResponse = collection.GetFirstDocument
Call doc.Save(True,True)
Msgbox 3
If doc.GetItemValue( "DC_ActiveDevice" )(0) = "Yes" Then
While Not currentResponse Is Nothing
If doc.UniversalID <> currentResponse.UniversalID Then
Set item = currentResponse.ReplaceItemValue( "DC_ActiveDevice", "" )
Call currentResponse.Save( True, True )
End If
Set currentResponse = collection.GetNextDocument(currentResponse)
Wend
End If
End Sub