| Hallo, |
| |
| ich weiß auch, dass da was nicht stimmt. |
| |
| Ich habe aber schon mal ein bisschen experimentiert und herausgefunden, dass diese "Vorgabemaske nicht gefunden"-Dokumente erstellt werden, wenn ich ein neues Dokument erstellen will, es nicht speichere wenn ich das Fenster schließe. Danach habe ich diese Dokumente. Dies passiert auch bei anderen Datenbanken, die das gleiche Skript enthalten. |
| |
| Ich schreib euch mal was für Skripte überhaupt in meinen Masken sind: |
| |
| Sub Postopen(Source As Notesuidocument) |
| Dim sess As New NotesSession |
| Dim doc As NotesDocument |
| Dim thatUser As String |
| Set doc = source.document |
| If Source.EditMode Then |
| If doc.HasItem("LockEdit") Then |
| Source.EditMode = False |
| thatUser = doc.LockEdit(0) |
| Msgbox thatUser & " bearbeitet derzeit dieses Dokument. Solange dieser Benutzer es bearbeitet, können sie nichts ändern." |
| Else |
| Call doc.ReplaceItemValue("LockEdit", sess.CommonUserName) |
| Call doc.ReplaceItemValue("LockEditTime", Now) |
| Call doc.Save(True, True) |
| End If |
| End If |
| End Sub |
| |
| Sub Querymodechange(Source As Notesuidocument, Continue As Variant) |
| Dim sess As New NotesSession |
| Dim doc As NotesDocument |
| Dim thatUser As String |
| Set doc = source.document |
| If Source.EditMode Then |
| Continue = True |
| Else |
| If doc.HasItem("LockEdit") Then |
| thatUser = doc.LockEdit(0) |
| Msgbox thatUser & " bearbeitet derzeit dieses Dokument. Solange dieser Benutzer es bearbeitet, können sie nichts ändern." |
| Continue = False |
| Else |
| Continue = True |
| Call doc.ReplaceItemValue("LockEdit", sess.CommonUserName) |
| Call doc.ReplaceItemValue("LockEditTime", Now) |
| Call doc.Save(True, True) |
| End If |
| End If |
| End Sub |
| |
| Sub Querysave(Source As Notesuidocument, Continue As Variant) |
| |
| Dim session As New NotesSession |
| Dim db As NotesDatabase |
| Dim parentUNID As String |
| Dim ParentDocument As NotesDocument |
| Dim sa As NotesItem |
| Dim saValue As String |
| Dim responses As NotesDocumentCollection |
| Dim doc As NotesDocument |
| Set db = session.CurrentDatabase |
| Set doc = Source.Document |
| parentUNID = doc.ParentDocumentUNID |
| Set ParentDocument = db.GetDocumentByUNID(parentUNID) |
| Set responses = ParentDocument.Responses |
| Set doc = responses.GetFirstDocument |
| Do While Not doc Is Nothing |
| Set sa = doc.GetFirstItem("SA") |
| saValue = sa.Values(0) |
| If saValue = "ja" Then |
| ParentDocument.FeldName = "Ja" |
| Call ParentDocument.Save(True,True) |
| Exit Sub |
| End If |
| Set doc = responses.GetNextDocument(doc) |
| Loop |
| ParentDocument.FeldName = "Nein" |
| Call ParentDocument.Save(True,True) |
| |
| End Sub |
| |
| Sub Queryclose(Source As Notesuidocument, Continue As Variant) |
| Dim sess As New NotesSession |
| Dim doc As NotesDocument |
| Set doc = source.document |
| If doc.LockEdit(0) = sess.CommonUserName Then |
| Call doc.RemoveItem("LockEdit") |
| Call doc.RemoveItem("LockEditTime") |
| Call doc.Save(True, True) |
| End If |
| End Sub |
| |
| |
| Mfg Marco |