QueryOpen (NotesUIView - LotusScript®)

Occurs just before the current view is opened.

Defined in



QueryOpen(Source As Notesuiview, Continue As Variant)



NotesUIView. Read-only. The current view.


Boolean. Read-write. Indicates whether or not the view will be opened. Set this parameter to False if you do not want the view to open.


When you create a script that responds to this event, Domino® creates the syntax of the event for you (including the parameters). You do not need to type it in.

Because the event occurs before the document opens, you cannot use the Source argument to do "front end" operations such as setting field values.

For an existing document (IsNewDoc = False), you can use Source.Document to get the back-end NotesDocument, and use that to read or assign fields. If you assign fields, it is not necessary to save the NotesDocument because the new values will be visible when the form opens.

However, if the form is opened by a compose operation (IsNewDoc = True), there is no back-end document, so Source.Document returns "Nothing." To assign fields in a document being composed, use the PostOpen event or the fields' Default value formulas.

The Queryopen event is not a security feature. To control access to information, use Readers fields, Authors fields, and field-level encryption - not event code or hide formulas.

If you use Queryopen as a way of restricting access to the document contents, it is easy for users to view the field information in other ways. For example, a user can open the Document Properties infobox from a view, or copy the document to a local database where they are the manager, or use the LotusScript® debugger to abort the Queryopen processing.