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

Posted on 2004-11-22
Last Modified: 2013-12-18
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.)
Question by:Blackmoorian
    LVL 31

    Assisted Solution

    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.
    LVL 4

    Author Comment

    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.

    LVL 4

    Author Comment

    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.
    LVL 31

    Accepted Solution

    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
    LVL 4

    Author Comment

    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.
    LVL 4

    Author Comment

    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.
    LVL 31

    Expert Comment


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

    - qwaletee
    LVL 4

    Author Comment

    Thanks for the assistance on this Qwaletee. Sorry I took so long testing this out, but with your assistance it seems to work. Thanks.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Security Threats Are You Missing?

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    This is an old article, please see an updated version of this article, located here:
    For beginners of Lotus Notes user this is important to know about the types of files and their location supported by IBM Notes. Mostly users are unaware about how many file types are created and what their usages are. This Article is fully dedicated…
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now