Das Notes Forum

Domino 9 und frühere Versionen => ND6: Entwicklung => Thema gestartet von: jo@chim am 04.12.06 - 09:22:43

Titel: NotesUIDocument: Save Cancelled
Beitrag von: jo@chim am 04.12.06 - 09:22:43
Ich habe im Querysave einer Maske eine Eingabevalidierung per selbstprogrammierter Funktion "proofInput(Source) as Boolean":

Sub Querysave(Source As Notesuidocument, Continue As Variant)
On Error Resume Next
Source.Refresh   
If proofInput(Source) = False Then
continue = False
Exit Sub
End If
'... weiterer Code ...
End Sub

Die Fehlermeldung "NotesUIDocument: Save Cancelled" wird aber (entgegen der Tipps zum Thema auch hier im Forum) durch die Fehlerroutine nicht abgefangen.

Any Hints?

P.S.: Notes Version 6.5.5

Titel: Re: NotesUIDocument: Save Cancelled
Beitrag von: Glombi am 04.12.06 - 10:19:56
Ich sehe hier aber kein korrektes Error Handling. Resume Next ist das jedenfalls nicht.

In den Tipps steht bestimmt sowas:

Sub Querysave(Source As Notesuidocument, Continue As Variant)
On Error Goto Error_Refresh
Source.Refresh   
If proofInput(Source) = False Then
continue = False
Exit Sub
End If
'... weiterer Code ...

Ende:
End Sub

Error_Refresh:
continue = False
Resume Ende


Andreas
Titel: Re: NotesUIDocument: Save Cancelled
Beitrag von: jo@chim am 04.12.06 - 10:51:01
Negativ Sir. Ich hab das jetzt so eingebunden:
Code
Sub Querysave(Source As Notesuidocument, Continue As Variant)
	On Error Goto Error_Refresh
	Source.Refresh   
	If proofInput(Source) = False Then
		continue = False
		Exit Sub
	End If
	Exit Sub
Ende:
Error_Refresh:
	continue = False
	Resume Ende
End Sub
Fehlermeldung tritt nach wie vor auf.
Titel: Re: NotesUIDocument: Save Cancelled
Beitrag von: Glombi am 04.12.06 - 11:00:02
So:

Sub Querysave(Source As Notesuidocument, Continue As Variant)
   
   On Error Goto Error_Refresh
   Source.Refresh   
   
   If proofInput(Source) = False Then
      continue = False
      Exit Sub
   End If
'... weiterer Code ...
   
Ende:
   Exit Sub
   
Error_Refresh:
   continue = False
   Resume Ende
   
End Sub



Wenn es immer noch auftritt, liegt es evtl. am
proofInput(Source) =

Was macht die Funktion?

Andreas
Titel: Re: NotesUIDocument: Save Cancelled
Beitrag von: Axel am 04.12.06 - 11:09:13
Ich habe die Sache bei mir mal nachgestellt, allerdings ist meine proofInput - Funktion nur eine Rumpf-Funktion und liefert immer false zurück.

Bei mir kommt keine Fehlermeldung. Das muss irgendwo anders herkommen. Evt, wie Andreas schon sagte in der proofInput-Funktion, oder von irgendwelchen Validierungsformeln o.ä. in der Maske


Axel
Titel: Re: NotesUIDocument: Save Cancelled
Beitrag von: jo@chim am 04.12.06 - 12:55:46
An der Funktion liegt es nicht, die testet nur ein paar Feldwerte - auch

Code
Sub Querysave(Source As Notesuidocument, Continue As Variant)	
	On Error Goto Error_Refresh
	continue = False
Ende:
	Exit Sub	
Error_Refresh:
	Resume Ende	
End Sub

liefert den Fehler ...
Titel: Re: NotesUIDocument: Save Cancelled
Beitrag von: Glombi am 04.12.06 - 13:02:08
Dann wird der Fehler wohl durch eine Teilmaske erzeugt, denn im Code findet ja nun gar kein Refresh mehr statt!
Titel: Re: NotesUIDocument: Save Cancelled
Beitrag von: jo@chim am 04.12.06 - 13:15:12
Ich hatte in der gemeinsamen Aktion "Dokument speichern" noch einen unnötigen Refresh ...
Herzlichen Dank für die Hilfe - jetzt klappts auch mit dem QuerySave  :)