Hi
I have what is probably a basic issue, but not sure how to go about it…
I have a form, which when saved, it should check the status of a field, if the field = “Finished” then 6 other fields cannot be blank / not filled out and a message needs to appear. If the field is anything else, the 6 other fields do not need to be filled out
How can I do this ?
Thanks
Scott
Subject: Input Valdidation - Querysave
It is fairly basic - what’s your knowledge of lotusscript like?
Essentially you just need to get the current document (workspace.currentdocument) and then check the field values (notesuidocument.fieldgettext) - to stop the document saving if the necessary conditions aren’t met use continue = false in your code.
Give it a go and post back any attempts that don’t work - you’ll generally find you get people more willing to help out if you’ve at least had a go and post some code.
Check the help for examples of course, and search the forum, I expect the exact code you want is here somewhere.
Subject: RE: Input Valdidation - Querysave
Hi,
Here is the sample code i hope this will help you…
Dim ss As New NotesSession
Dim db As NotesDatabase
Dim ws As New NotesUIWorkspace
Dim uidoc As NotesuiDocument
Dim doc As NotesDocument
Set db=ss.CurrentDatabase
Set uidoc=ws.CurrentDocument
Set doc=uidoc.Document
If doc.field(0)="finished" Then
If doc.field1(0)="" Then
Msgbox "error"
Exit Sub
End If
cheers
RAJ
Subject: RE: Input Valdidation - Querysave
In the Querysave event
With Source.Document
If .field(0)="finished" Then
If .field1(0)="" Then
Continue = false
Msgbox "error"
Exit Sub
End If
end if
end with