Domino 9 und frühere Versionen > ND6: Entwicklung
Problem mit Dokument Berechtigungen
Axel:
Wenn das der Code im Querysave - Event ist, dann sollte das aber funktionieren.
Mit Continue = False wird das Speichern abgebrochen und mit Exit Sub wird die Ausführung des Events beendet.
--- Code: ---Sub Querysave(Source As Notesuidocument, Continue As Variant)
'Created on 13.02.06 by someone
Dim ThisDoc As NotesDocument
Set ThisDoc = Source.Document
'Checks the mandatory fields and stops saving if a field is empty
If Source.FieldGetText("country") = "" Then
source.GotoField("country")
Messagebox "Country field is empty", 0 + 48, "Failure"
Continue = False
Exit Sub
End If
End Sub
--- Ende Code ---
Woran erkennst du denn, dass das Dokument gespeichert wird.
Axel
judicious:
Sub Querysave(Source As Notesuidocument, Continue As Variant)
'Created on 13.02.06 by someone
Dim ThisDoc As NotesDocument
Set ThisDoc = Source.Document
'Checks the mandatory fields and stops saving if a field is empty
If Source.FieldGetText("country") = "" Then
source.GotoField("country")
Messagebox "Country field is empty", 0 + 48, "Failure"
Exit Sub
End If
If Source.FieldGetText("city") = "" Then
source.GotoField("city")
Messagebox "City field is empty", 0 + 48, "Failure"
Exit Sub
End If
If Source.FieldGetText("location") = "" Then
source.GotoField("location")
Messagebox "Location field is empty", 0 + 48, "Failure"
Exit Sub
End If
If Source.FieldGetText("detail") = "" Then
source.GotoField("detail")
Messagebox "Detail field is empty", 0 + 48, "Failure"
Exit Sub
End If
If Source.FieldGetText("Description") = "" Then
source.GotoField("Description")
Messagebox "Description field is empty", 0 + 48, "Failure"
Exit Sub
End If
End Sub
Das ist mein Code.
Woran ich das sehe, ich sehe das Dokument in den Views ;)
Edit: Mann mann mann, ich habe noch einen sehr spezielen Fehler :) Immer wenn ich die DB aufmache mit einem Doppelklick auf das Icon gehen gleich zwei Formulare mit auf. Aber komischerweise nicht immer, sondern so nach Lust und Laune ???
koehlerbv:
Und wo ist das Continue = False abgeblieben? Das Event heisst ja QUERYsave - gespeichert wird später - solange nicht Continue = False ist.
Bernhard
judicious:
Habe ich einfach rausgelassen weil sonst wieder der Fehler kommt: Cannot execute the specified command.
Um die anderen FUnktionen zu testen ist es einfacher wenn der Fehler nicht kommt ;)
koehlerbv:
Vorhin war es doch noch Call Source.Close, was (logischerweise) den Fehler warf ...
Navigation
[0] Themen-Index
[#] Nächste Seite
[*] Vorherige Sete
Zur normalen Ansicht wechseln