.
HCLSoftware Business Partner
Domino Consulting Services
CRUCIAL Notes Tools
+1
212-599-2048
Domino Consulting Services
CRUCIAL Notes Tools
Domino administration
Notes development
Chat now
.
EN - English
CN - 中文
JP - 日本語
DE - Deutsch
FR - Français
BR - Português
RU - Pу́сский
IT - Italiano
IN - हिन्दी
ES - Español
KR - 한국어
ID - Indonesia
NL - Dutch
TR - Türkçe
SA - العربية
SE - Svenska
NO - Norsk
PL - Polski
TH - ไทย
DK - Dansk
MY - Malay
PH - Filipino
GR - Ελληνικά
FI - Suomi
IL - עברית
IE - Gaeilge
CZ - Čeština
UA - Українська
RO - Română
VN - Tiếng Việt
BD - বাংলা
HU - Magyar
Need a Domino Consultant? Call NotesMail +1 212-599-2048
-
HCLSoftware Business Partner
LOTUSSCRIPT/COM/OLE CLASSES
Examples: QueryOpen event
1. This script prevents the user from creating a new document.
Sub Queryopen(Source As Notesuidocument, _
Mode As Integer, _
Isnewdoc As Variant, Continue As Variant)
If IsNewDoc Then
Messagebox _
( "Only one Setup document is permitted" )
continue = False
End If
End Sub
2. This script prevents the user from creating a Setup document if one already exists in the database. When the user tries to create a new document, the script checks whether there is a document in the Setup view. If so, a Setup document already exists in the database and the user is prevented from creating another one.
Sub Queryopen(Source As Notesuidocument, _
Mode As Integer, _
Isnewdoc As Variant, Continue As Variant)
Dim session As New NotesSession
Dim db As NotesDatabase
Dim view As NotesView
Dim doc As NotesDocument
' Check if the user is trying to create a new Setup doc
If IsNewDoc Then
Set db = session.CurrentDatabase
Set view = db.GetView( "Setup" )
Set doc = view.GetFirstDocument
' Check if a Setup doc already exists in the db
If Not ( doc Is Nothing ) Then
Messagebox _
("Only one Setup document permitted.")
' If so, don't let user create another one
continue = False
End If
End If
End Sub
3. This script checks whether the user has a Supervisor role in the ACL. If so, the user can open the document; if not, or if the user is not listed in the access control list, the user cannot open the document.
Sub Queryopen(Source As Notesuidocument, _
Mode As Integer, _
Isnewdoc As Variant, Continue As Variant)
Dim session As New NotesSession
Dim db As NotesDatabase
Dim acl As NotesACL
Dim entry As NotesACLEntry
Set db = session.CurrentDatabase
Set acl = db.ACL
Set entry = acl.GetEntry( session.UserName )
If ( entry Is Nothing ) Then
continue = False
Elseif Not ( entry.IsRoleEnabled( "Supervisor" ) ) Then
continue = False
End If
End Sub
See Also
QueryOpen event
Feedback on
Help
or
Product Usability
?
Help on Help
All Help Contents
Feedback on
Help
or
Usability
?
Help on Help
All Help Contents