Good morning, I have a problem with LotusScript below, I put it on the querysave event of the form, the first thing is checking the ResourceName, if it is blank, should not be Continue,but it does not, how to change the coding to fix this problem?
Thanks in advance.
Linda
…
Dim doc1 As NotesDocument
Set doc1= Source.document
If Source.Document.ResourceName(0)="" Then
Messagebox " Please click available button and choose a resource."
Call source.GotoField( “ResourceName” )
Continue = False
End If
If Source.IsNewDoc Then
Set item = source.document.GetFirstItem( "repeat" )
Forall v In item.Values
Set view=db.getview("LookUp")
'akey=source.Document.ResourceName(0)+Str(source.Document.calendarDate(0))
akey=source.Document.ResourceName(0)+v
Set doc=view.GetDocumentByKey(akey)
If Not doc Is Nothing Then
Messagebox "The date " + v+ " was booked"
Continue=False
Exit Sub
Else
Set ndoc=db.CreateDocument
ndoc.form="Reservation"
ndoc.ReservedBy=doc1.ReservedBy(0)
ndoc.sDate=doc1.sDate(0)
ndoc.eDate=doc1.eDate(0)
ndoc.calendarDate=Cdat(v)
ndoc.repeat=doc1.repeat
ndoc.ResourceName=doc1.ResourceName(0)
ndoc.Description=doc1.Description(0)
Call ndoc.MakeResponse( doc1 )
Call ndoc.Save( False, True )
End If
End Forall
End If