Manage Learn to apply best practices and optimize your operations.

A Function To Simulate R5'S @Namelookup In R4.6

A function to simulate R5's @NameLookup in R4.6
With this function you can lookup a user and return any field from the Person
key, the user to lookup, usualy a shortname
retfield, the field on the person doc that you want
retindex, if retfield has multiple values which one do you want?
Function LookupUser(key As String, retfield As String, retindex As Long) As
On Error Goto DoError

Dim ws As New NotesUIWorkSpace
Dim session As New NotesSession
Dim db As NotesDatabase
Dim server As String
Dim view As NotesView
Dim doc As NotesDocument
server = session.GetEnvironmentString("MailServer", True)
Set db = session.GetDatabase(server, "names.nsf")
Set view = db.GetView("($Users)")
Set doc = view.GetDocumentbyKey(key, True)

tmpArray = doc.GetItemValue(retfield)

LookupUser = tmpArray(retindex)

Exit Function
If doc Is Nothing Then
Print "User " & key & " not found."
LookupUser = key
Exit Function
End If
End Function

Dig Deeper on Domino Resources - Part 2

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 ...