Update Multiple Person Documents w/Lotusscript

Can anyone shed some light on how I can add an additional entry into everyone’s ‘User name:’ field of their Person Document using lotusscripting? I already have a script to register all of the users using the RegisterNewUser method.

Thanks.

Subject: Update Multiple Person Documents w/Lotusscript

Darren

You need to create a LS Agent, i would say do this in a empty NSF rather than create it in the NAB… The script would go something like this, assuming that you want to do this to every user

  1. Create the NSF on the server that PAB resides on

  2. Create an agent in the blank file

  3. The Agent Trigger should be “ON EVENT”

  4. The Agent Event should be “Action Menu Selection”

  5. The Target should be “NONE”

  6. The agent code will look something like this

Sub Initialize

Dim ThisSession As New NotesSession

Dim ThisDB As NotesDatabase

Dim NabDB As NotesDatabase

Dim NabView As NotesView

Dim NabDoc As NotesDocument

Dim NabItem As NotesItem

	

Set ThisDB = ThisSession.CurrentDatabase

Set NabDB = ThisSession.GetDatabase(ThisDB.Server, "Names.nsf")

Set NabView = NabDB.getView("People")

Set NabDoc = NabView.GetFirstDocument

Do While Not (NabDoc Is Nothing)

	Set NabItem = NabDoc.GetFirstItem("FullName")

	Call NabItem.appendToTextList( ... whatever it is you want to add ..)		

	Call NabDoc.Save(True,False)

	Set NabDoc = NabView.GetNextDocument(NabDoc)		

Loop

Messagebox("Done")

End Sub

  1. Save your agent

  2. Run The agent

**** WARNING ****

Since this is your NAB … TAKE A BACKUP UP FIRST!!! alternately make a NEW COPY of your name and work on that until you are happy with it!

Steve