Q
Problem solve Get help with specific problems with your technologies, process and projects.

Create groups based on location field in NAB

I am trying to create an agent which creates groups based on location field in the NAB and members to the group. How do I do this?

Try this out to start with and expand for your situation:

 Dim nsCurrent As New NotesSession Dim ndbNAB As NotesDatabase Dim nvPeople As NotesView Dim ndPerson As NotesDocument Dim ndGroup As NotesDocument Dim nvGroups As NotesView Dim l_sLocation List As String Set ndbNAB = nsCurrent.CurrentDatabase Set nvPeople = ndbNAB.GetView("($Users)") Set ndPerson = nvPeople.GetFirstDocument While Not ndPerson Is Nothing l_sLocation(ndPerson.Location(0)) = l_sLocation & ", " & ndPerson.MailAddress(0) Set ndPerson = nvPeople.GetNextDocument(ndPerson) Wend ForAll L In l_sLocation Set ndGroup = nvGroups.GetFirstDocumentByKey(ListTag(l_sLocation)) If ndGroup Is Nothing Then Set ndGroup = ndbNAB.CreateDocument ndGroup.Form = "Group" ndGroup.Name = ListTag(L)) End If NdGroup.Members = L Call ndGroup.ComputeWithForm(False) Call ndGroup.Save(True, False) End ForAll

Depending on the version of Notes you are running, you might want to double-check and make sure ComputeWithForm works for you in expanding the group members. If it doesn't, then use a little code to explode the contents of "L" and put them in the group using a NotesItem and its method "AppendToTextList".


Dig Deeper on Domino Resources - Part 3

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

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