Hallo,
ich bins mal wieder.
Ich habe ein Hauptdokument.
Das Hauptdokument schreibt beim Speichern 3 Felder in alle Antwortdokumente.
Manchmal sind die Antwortdokumente noch im Bearbeitungsmodus. Des selben Users.
Ich habe nun diesen Artikel hier gefunden:
http://atnotes.de/index.php/topic,29937.0.htmlDiese Funktion habe ich nun Probeweise in das QuerySave eingebaut.
Es funktioniert aber nicht. Funktioniert doc.IsUIDocOpen auch bei QuerySave nicht?
Gibt es vielleicht eine Alternative?
| Sub Querysave(Source As Notesuidocument, Continue As Variant) |
| Dim session As New NotesSession |
| Dim db As NotesDatabase |
| Dim dc As NotesDocumentCollection |
| Dim doc As NotesDocument |
| 'Test Variabelen |
| Dim tmpDc As NotesDocumentCollection |
| Dim tmpDoc 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 |
| Set tmpdc = db.Search( |@False|,Nothing, 0 ) |
| Set dc = doc.Responses 'alle Antwortdocs des Backend-Docs werden in die Collection aufgenommen |
| Set tmpdoc = dc.GetFirstDocument |
| While Not tmpDoc Is Nothing |
| If tmpDoc.IsUIDocOpen Then ' tmpDoc wird Überprüft, das momentan Bearbeitete Doc wird aber nicht übersprungen |
| Set tmpDoc = dc.GetNextDocument(tmpDoc) |
| Else |
| Call tmpDc.AddDocument(tmpDoc) |
| Set tmpDoc = dc.GetNextDocument(tmpDoc) |
| End If |
| Wend |
| 'Setze alle Felder der Collection, gespeichert wird automatisch |
| Call tmpDc.StampAll( "DeletStatusKind" , doc.DeletStatusVater ) |
| End Sub |