Domino 9 und frühere Versionen > ND6: Entwicklung

LN-Meldung bei Validierung im QuerySave

(1/2) > >>

Alexis:
Hallo Forum,

kann man die Lotus Notes Meldung "NoteUIDocument Save cancelled" bei der Validierung von Feldern im QuerySave unterbinden?


--- Code: ---Sub Querysave(Source As Notesuidocument, Continue As Variant)
Dim ws As New NotesUIWorkspace
Dim uidoc As NotesUIDocument
Set uidoc = ws.CurrentDocument
If uidoc.FieldGetText("SupportCenter") = "" Then
Messagebox "Please select Support Center"
continue = False
End If
End Sub
--- Ende Code ---

Alexis

koehlerbv:
Das spricht dafür, dass Du auch Validierungsformeln verwendest. Man sollte sich da auf ein Verfahren einigen.
Im QuerySave kannst Du aber zu Beginn den Errorstatus abfragen und ggf. QuerySave gleich verlassen.

Bernhard

Alexis:
Sorry Berhard,

auch mit


--- Code: ---Sub Querysave(Source As Notesuidocument, Continue As Variant)
Dim ws As New NotesUIWorkspace
Dim uidoc As NotesUIDocument

On Error Goto Errhandle

Set uidoc = ws.CurrentDocument
If uidoc.FieldGetText("SupCenter") = "" Then
Messagebox "Please select Support Center"
continue = False
End If

Errhandle:
Messagebox "Error" & Str(Err) & ": " & Error$
End Sub
--- Ende Code ---

bekomme ich den Errorcode 0 zurück
danach die besagte LN-Meldung.

???

Da muss wohl was anderes noch mitspuken.

Alexis

koehlerbv:
Nach dem Continue = False fehlt noch ein Exit Sub, Du nimmst also den Fehlerstatus weiter mit, anstatt ihn zu zerstören. QuerySave wird so "normal" verlassen - mit der Kenntnis über einen Fehler.

HTH,
Bernhard

Alexis:
Hallo Bernhard,

auch wenn ich nerve:

Exit Sub hilft auch nicht!

Interessanterweise klappt es, wenn ich über das Schließen des Workspaces (X) gehe.

Alexis

Navigation

[0] Themen-Index

[#] Nächste Seite

Zur normalen Ansicht wechseln