Lotus Notes FAQ Visit Our Sponsor!

How do you make user registration immediate?

There are several ways to do this. These techniques involve updating the index of the appropriate NAB which contains the newly registered users:

Open the Person Document View in the Browser
When you register a new Person document in the NAB, change the $$return variable to open the new person document with this:

  "[/names.nsf/($users)/" + @ReplaceSubString(fullname; " "; "+") + "]"

This will cause the index of that view to be updated so that the next username look up will work.

Run the updall Program
In the Terminate Event of the registration form, you can add the following LotusScript:

  Dim progname As String
  progname = "d:\notes\nupdall names.nsf"
  taskID = Shell (progname, SHELL_MAX_FOCUS)

You will have to adjust the updall name and path as appropriate for your system.

Do a View Lookup with the Notes API
Add this to your Declarations section:

  ' NAMELookup and OSMemFree are used in EnsureUserInNAB.
  ' NOTE: if you are running this app on a platform other than
  ' Windows 32 Intel, then you will have to change the name of the
  ' dll in these two declarations. Look in your Notes executable
  ' directory for *notes.dll to see what it is called, or for the proper
  ' form of shared library on your platform.

  Declare Sub NAMELookup Lib "nnotes.dll" _
  (Byval serverName As Integer, _
   Byval flags As Integer, _
   Byval numNameSpaces As Integer, _
   Byval nameSpaces As String, _
   Byval numNames As Integer, _
   Byval names As String, _
   Byval numItems As Integer, _
   Byval items As String, _
   rethBuffer As Long _
  )

  Declare Sub OSMemFree Lib "nnotes.dll" (Byval hBuffer As Long)

Now create a new sub:

  ' This sub is used to guarantee that the NAB view of users is up-to-date
after adding a new
  ' user. Domino 1.5 does not force the view to be up-to-date when
authenticating users, so
  ' we'll do it ourselves so the user can start working right away.

  Sub EnsureUserInNAB(Byval fullname As String)
    Dim hBuf As Long 
    Call NAMELookup(0, 0, 1, "$Users", 1, fullname, 1, "HTTPPassword", hBuf)
    Call OSMemFree(hBuf)
  End Sub

Then, once you have modified all of the documents in the NAB you are going to modify, call EnsureUserInNAB with the user's full name. The NAB will be up-to-date.
This technique is used in Lotus' Domino Registration sample.


Applies to Notes Versions: 4, 4.5, 4.6, 5
Last Modified: September 8, 1999