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 Wend doc.Results = results End Sub