• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 665
  • Last Modified:

Need a field in "Group" form of name & address book that displays all users contained in group (including nested groups)

I created a multi-value, Computed for Display, Names field in the "Group" form of the public name & address book with the following value:

@If(@IsNewDoc;"";@Name([CN];@ExpandNameList("NOTESMAIN":"names.nsf";ListName)))

I am aware that @ExpandNameList is not supported by Lotus and from the results can see why. ACL Groups did not expand and if you make any changes to the members of a group the new list does not update when opened up again. So it is as if we took a snapshot and are stuck with that. Since I need this field to work due to pressure from up above and have no experience with LotusScript I turn to this community since I see no alternative than to script this. I have seen similar requests and have tried to implement those solutions to no avail, it is still not working.

My requirements for this are:

1) User does not need editor access in order to get this to work.
2) When the document is opened up by the user either directly in the Name & Address book or through the details button of the address dialog, a current list is seen in the new field. Field will not need to be displayed in any view whatsoever just the form.
3) The field must display all the users contained within all the groups nested within the main group. (It would be nice if there were no duplicates however that is not an issue and duplicates are fine, just recursing all subgroups and gathering a list of all users is more important.) For example:
     Main Group - Group1, User1, Group2, User2, User3
     Group1 - Group3, User4, User5
     Group2 - User6, User7
     Group3 - User8, User9

     The field should show User1,User2,User3,User4,User5,User6,User7,User8,User9
4) There should not be any limit on the levels of nesting of groups and subgroups.
5) Solution should be well commented so novice scripter can understand and learn from the script. (I believe wholeheartedly in the old addage about teaching a man to fish. I would rather learn how to do something rather than it just be given me and I not understand the solution even if it works great.)
0
Blackmoorian
Asked:
Blackmoorian
  • 5
  • 3
2 Solutions
 
qwaleteeCommented:
To make it update each time, just make the field computed for display.  You can eliminate duplicates with @Unique(@Exp....).  There is no limit on levels, other than any limits Notes has on nesting groups to begin with.

Note that one problem you could run into is max field size.  A text field can contain a maximum of 15k of data.  So, if the returned list is too large, it can't display.

The ACL groups are an issue you can't work around, unless you want a much more complex solution.
0
 
BlackmoorianAuthor Commented:
The field is already set to be Computed for Display but does not update at all with newer changes. Figured this quirk was one of the reasons that @ExpandNameList is not supported at this time.

ACL groups are a nuisance however can be worked around, we mainly need mail and multi groups to display at this time, will change the group type if an ACL only group is needed. Mainly the many requesters of this information are wanting to be able to see everyone that will receive an e-mail when that group is selected to send information to.

Also for reference we are running Lotus Domino 5.0.12 just in case version is an issue.

0
 
BlackmoorianAuthor Commented:
Change of plans, if at all possible we need to display ACL groups as well. We can work around it but if there is a solution that does not require us to work around this issue it would be greatly appreciated.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
qwaleteeCommented:
You woudl have to construct a looping mechanism in LotusScript to do this.  Something like:

Function getAllGroupMembers( lookupName As String ) As Variant
    Static init As Integer
    Static session as notesSession, directory as notesDatabase, lookup As notesView, priorGroups List As Integer
    Dim rootCall As Integer
    If Not init
        initialize = True 'so nobody else will both on recursive calls
        rootCall = True 'so we can clean up
        Dim allgroupMembers() as string
        Redim AllGroupMembers(0)
        If sesion is Nothing Then
            Set session = new notesSession
            Set directory = session.currentDatabase
            Set lookup = "($Users)"
        End If
    End If
   
    Dim matchDoc as notesDocument
    Set matchDoc = lookup.getDocumentByKey(lookupName , True )
    If IsElement(priorGroups(lookupName) Then
        'nop - ignore
    ElseIf matchDoc Is Nothing Then
        'must be a user name
        AllGroupMembers(Ubound(AllGroupMembers)) = lookupName
        Redim Preserve AllGroupMembers(Ubound(AllGroupMembers)+1)
    ElseIf matchDoc.Type(0) = "List" Then
        Forall member in matchDoc.Members
            getAllGroupMembers member 'recursively run over all the additional names
        End Forall
    End If
    If rootCall Then
        init = False 'so next call will start over
        getAllGroupMembers = AllGroupMembers
        Erase priorGroups , AllGroupMembers 'do not cache
    End If
End Function
0
 
BlackmoorianAuthor Commented:
My apologies I have been in and out of the office the last few weeks and does not look like I will be able to test this until after the new year. Thank for you assistance and hopefully I will be able to implement this shortly. I will let you know if there are any further questions that arise from this solution.
0
 
BlackmoorianAuthor Commented:
Sorry I have been out of the office on other issues adn have not had a chance to test out the solution presented. I have not abandoned the question, just have not been able to determine if the solution given answered my issue.
0
 
qwaleteeCommented:
TheLearnedOne,

It's only been 11 days since the last reply (even though it was just a checking-in message).

- qwaletee
0
 
BlackmoorianAuthor Commented:
Thanks for the assistance on this Qwaletee. Sorry I took so long testing this out, but with your assistance it seems to work. Thanks.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 5
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now