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:


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.)
BlackmoorianDirector of Professional ServicesAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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.
BlackmoorianDirector of Professional ServicesAuthor 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.

BlackmoorianDirector of Professional ServicesAuthor 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.
Cloud Class® Course: Microsoft Windows 7 Basic

This introductory course to Windows 7 environment will teach you about working with the Windows operating system. You will learn about basic functions including start menu; the desktop; managing files, folders, and libraries.

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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
BlackmoorianDirector of Professional ServicesAuthor 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.
BlackmoorianDirector of Professional ServicesAuthor 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.

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

- qwaletee
BlackmoorianDirector of Professional ServicesAuthor 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.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Lotus IBM

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.