Dim session As New NotesSession
Dim db As NotesDatabase
Dim dc As NotesDocumentCollection
Dim doc As NotesDocument
Set db = session.CurrentDatabase
If Source.IsNewDoc Then Exit Sub 'Wenn UIDoc neu ist dann verlasse Script
Set doc = Source.Document 'UIDoc zu Backend-doc
'alle Antwortdocs des Backend-Docs werden in die Collection aufgenommen
Set dc = doc.Responses
'Setze alle Felder der Collection, gespeichert wird automatisch
Call dc.StampAll( "WerteinesPunktes" , doc.BetragjePunkt(0) )
Sub Queryclose(Source As Notesuidocument, Continue As Variant)
Dim ndAntwort As NotesDocument
Dim ndHaupt As Notesdocument
Dim uidoc As NotesUIDocument
Set ndAntwort = Source.Document
Dim Ref As String
Ref = ndAntwort.ParentDocumentUNID
Dim ndb As NotesDatabase
Set ndb=source.Document.Parentdatabase
Set ndHaupt=ndb.getdocumentbyUNID(Ref)
Call ndHaupt.Save(True, False)
End Sub
Klappt aber nicht, durch das Saven im Backend wird das Querysave oben nicht aufgerufen.Jup, ist so. Aus der Designer-Hilfe:
QuerySave event
...
Defined in
NotesUIDocument
Sub Queryclose(Source As Notesuidocument, Continue As Variant)
Dim ndAntwort As NotesDocument
Dim ndHaupt As Notesdocument
Set ndAntwort = Source.Document
Dim ndb As NotesDatabase
Set ndb=ndAntwort.Parentdatabase
Set ndHaupt=ndb.getdocumentbyUNID(ndAntwort.~$Ref(0))
' // FELDER SETZEN
Call ndHaupt.Save(True, False)
End Sub
Sub Queryclose(Source As Notesuidocument, Continue As Variant)
Dim ndAntwort As NotesDocument
Dim ndHaupt As Notesdocument
Dim uidoc As NotesUIDocument
Set ndAntwort = Source.Document
Dim Ref As String
Ref = ndAntwort.ParentDocumentUNID
Dim ndb As NotesDatabase
Set ndb=source.Document.Parentdatabase
Set ndHaupt=ndb.getdocumentbyUNID(Ref)
'alle Antwortdocs des Backend-Docs werden in die Collection aufgenommen
Set dc = ndHaupt.Responses
'Setze alle Felder der Collection, gespeichert wird automatisch
Call dc.StampAll( "WerteinesPunktes" , ndHaupt.BetragjePunkt(0) )
End Sub