Document Exiting

Hi,

Is there any way to stop exiting from a document , if a validation does not pass? The code is in Lotus Formula and in the QuerySave event of the form.

Subject: Document Exiting

Hi Sandip

Will u please pass your problem eloborately?

DEVs’’

Subject: RE: Document Exiting

Hi Dev,

Actually I am using the following code in the QuerySave event :

@If(@Attachments>1;@Do(

@Prompt([Ok];“Attachments”;“Please attach only one document”);@SetField(“SaveOptions”; 0));“”)

If the validation fails, the form is not getting saved , but its closing. I want to stop this i:e I do not want the form to get closed when the validation fails. Is it possible?

Subject: RE: Document Exiting

HI

write same thing in Input validation in the field formula

and tried out

i hope i help u?

/DEVs’'\

Subject: RE: Document Exiting

Hi,

but a richtext filed does not have any input validation. I solved this by adding the following code in the QueryClose event.

Sub Queryclose(Source As Notesuidocument, Continue As Variant)

Dim workspace As New NotesUIWorkspace 

Dim session As NotesSession

Dim db As NotesDatabase

Dim uidoc As NotesUIDocument 

Dim doc As NotesDocument

Set session = New NotesSession

Set db = session.CurrentDatabase

Set uidoc = workspace.CurrentDocument

Set doc = uidoc.Document 

If uidoc.FieldGetText ("SaveOptions") = 0 Then

	Continue = False

	Call uidoc.FieldSetText ("SaveOptions", "1")

	Exit Sub

End If

End Sub