Document QuerySave event code not executing when doc saved

Afternoon all,

I have a document which is displayed in a frameset on the notes client. I have a button (labelled “Save”) on the form with the formula @Command([FileSave]).

When the button is pressed some lotusscript in the forms QuerySave event is fired to check that a value has been entered in a multivalue field named “codeCategory”. If the field is blank a hidden field on the form named “SaveOptions” is set to “0” thus not saving the document and suppressing the save dialogbox if the form is then closed.

The problem is that the QuerySave event does not appear to be firing. I have included my QuerySave event code below.

Can anyone help?

Thanks in advance,

B.

Sub Querysend(Source As Notesuidocument, Continue As Variant)

Dim currentDoc As NotesDocument

Dim item As NotesItem



Set currentDoc = Source.Document

Set Item = currentDoc.GetFirstItem("codeCategories")



If (Item.Values = "") Then

	currentDoc.SaveOptions = 0

	Continue = False

Else

	currentDoc.SaveOptions = 1	

End If



Set Item = Nothing

Set currentDoc = Nothing

End Sub

Subject: RE: Document QuerySave event code not executing when doc saved…

Hmmm, it seems you post the querysend event… maybe it’s the matter…

Subject: RE: Document QuerySave event code not executing when doc saved…

Thank you,

Can’t believe I didn’t spot that…

I have one more question, I have added a delete button to a view with the formula @DeleteDocument but when I tick a document and click th button nothing happens.

Any ideas?

Thanks for your help,

B.

Subject: RE: Document QuerySave event code not executing when doc saved…

@DeleteDocument works only in agents.

Subject: Perhaps its in the wrong place? Querysend is not QuerySave