Hi!
I have a form that is accessible by different group which are assigned to different roles. On querymodechange, I would like to disable edit to the document if that status' field value is changed and of a particular role.
For example, edit IS possible if the value of Status field is "yes" and user's role is "[TeamA]". In a click of a button (found in the document), the Status' value changes to "No". At this point, user with role "[TeamA]" should NOT be able to edit the document. Also, the role is dependent to the value of Department field. So i still need to get the value of the Department field before I can identify the role of a user.
I've tried this script, but it always returns a error message "Type Mismatch":
Dim s As New NotesSession
Dim db As NotesDatabase
Dim doc As NotesDocument
Dim deptRole As String
Dim depName As String
Dim entry As NotesACL
Dim item As NotesItem
Set db = s.CurrentDatabase
Set doc = New NotesDocument (db)
Set item = doc.GetItemValue ("DEPARTMENT_1")
depName = "[" & doc.department(0) & "]"
roles = db.QueryAccessRoles(session.UserName)
Forall r In entry.Roles
If roles(0) = "[TeamA]" Then
if status(0) <> "Yes" then
Messagebox "edit not allowed",, "Warning"
Continue = false
End Forall
End If
End If
End Forall
Please help.. Thanks so much!
I have a form that is accessible by different group which are assigned to different roles. On querymodechange, I would like to disable edit to the document if that status' field value is changed and of a particular role.
For example, edit IS possible if the value of Status field is "yes" and user's role is "[TeamA]". In a click of a button (found in the document), the Status' value changes to "No". At this point, user with role "[TeamA]" should NOT be able to edit the document. Also, the role is dependent to the value of Department field. So i still need to get the value of the Department field before I can identify the role of a user.
I've tried this script, but it always returns a error message "Type Mismatch":
Dim s As New NotesSession
Dim db As NotesDatabase
Dim doc As NotesDocument
Dim deptRole As String
Dim depName As String
Dim entry As NotesACL
Dim item As NotesItem
Set db = s.CurrentDatabase
Set doc = New NotesDocument (db)
Set item = doc.GetItemValue ("DEPARTMENT_1")
depName = "[" & doc.department(0) & "]"
roles = db.QueryAccessRoles(session.UserName)
Forall r In entry.Roles
If roles(0) = "[TeamA]" Then
if status(0) <> "Yes" then
Messagebox "edit not allowed",, "Warning"
Continue = false
End Forall
End If
End If
End Forall
Please help.. Thanks so much!