Manage Learn to apply best practices and optimize your operations.

Looking up fields in documents protected with Readers fields

This tip exploits an ancient weakness in the security model of Notes databases.

This tip exploits an ancient weakness in the security model of Notes databases. It describes how to retrieve values in documents that a particular user does not have access to because they are protected with readers fields.

To hide documents from users in a database a developer adds fields of type "readers". Unless a user is listed in the readers field or an author field on the document they cannot open the document. However field values of this document are still displayed in categorized views within the database. The categories can be accessed programmatically with @DBColumn and the NotesViewNavigator class.

Note: The user does need at least reader access to the database.

1) Create a lookup view and display the field that you would like to look up in a category. Be sure not to set the "Don't show categories having zero documents" property of the view.

You have two options to get to the values displayed:

2a) You create a lookup using @DBColumn which will retrieve the entire column. (@DbLookup returns "Server Error: Entry not found in index").

3a) If you'd like to get a result similar to a @DBLookup you need to resort to the LotusScript using the ViewNavigatorClass. Here is a sample button script that returns the lookup value in a field named "results":

       On Click 
                Dim session As New NotesSession
                Dim workspace As New NotesUIWorkspace
                Dim db As NotesDatabase
                Dim view As NotesView
                Dim doc As NotesDocument
                Dim uiDoc As NotesUiDocument
                Dim navigator As NotesViewNavigator
                Dim results() As String
                Dim entry As NotesViewEntry
                Dim count As Integer
                Set uiDoc = workspace.currentdocument
                Set doc = uidoc.document
                Set db = session.CurrentDatabase
                Set view = db.GetView("($All)")
                Set navigator = view.CreateViewnavfromCategory(doc.LUValue(0))
                If navigator Is Nothing Then
                                 Exit Sub
                End If
                count = 0
                Set entry = navigator.GetFirst
                While Not entry Is Nothing
                                 Redim Preserve results(count)
                                 results(count) = entry.ColumnValues(1)
                                 Set entry = navigator.GetNext(entry)
                                 count = count + 1 
                doc.Results = results 
        End Sub

Dig Deeper on Lotus Notes Domino Administration Tools

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.




  • iSeries tutorials's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...