Manage Learn to apply best practices and optimize your operations.

Validate a name against the NAB

The checkNAB function is a LotusScript function that compares a name with all the public NABs.

The checkNAB function is a LotusScript function that compares a name with all the public NABs. The name can be a person, group or mail-in db name. The function returns true if a name is found and false when a name isn't found.

I've found this to be a useful when I've asked the user to enter a name. The function ensures that the name entered is a valid Lotus Notes name within our environment.

Sub Click(Source As Button)
	Const NAME_OF_PERSON = "Joe Mamma"
	Const NAME_OF_PERSON2 = "Curtis R. Stull"
	
	Msgbox (NAME_OF_PERSON & " = " & CheckNAB( NAME_OF_PERSON ) & "  AND " 
& NAME_OF_PERSON2 & " = " & CheckNAB( NAME_OF_PERSON2 ) ) End Sub Function CheckNAB(strperson As String) As Integer Dim s As New NotesSession Dim view As NotesView Dim doc As NotesDocument books = s.AddressBooks Forall db In books If db.IsPublicAddressBook Then Call db.Open( "", "" ) If db.IsOpen Then Set view = db.GetView ( "($VIMPeopleAndGroups)" ) If Not view Is Nothing Then Set doc = view.GetDocumentByKey ( strperson ) ' if person is found then return true,
otherwise goto the next address book If Not doc Is Nothing Then CheckNAB = True Exit Function End If End If End If End If End Forall CheckNAB = False End Function
This was last published in April 2002

Dig Deeper on Lotus Notes Domino Administration Tools

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchWindowsServer

Search400

  • iSeries tutorials

    Search400.com'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 ...

SearchDataCenter

SearchContentManagement

Close