Yesterday I wrote about the new Auto-Populated Groups in Domino 8.5 . Today I want to show, how you can tweak this feature by just adding a new subform to names.nsf on the server and not using any additional code or modifying existing code to make the feature work.
As we learned yesterday, Domino uses LDAP and a LDAP Query to populate the members field in an auto-populated group.
In 8.5 Beta 1 you can only select the option “HomeServer” in the “Auto Populate Method” field which results in a fixed string in the “SelectionCriteria” field . This field is computed and you cannot modify its value.
We could easily make this field editable. But this means to modify the standard coding which is not always a good idea.
But you can achieve the aim in another way. Follow these steps
- Create a new subform
- Create a new field on the subform ( SelectionCriteria, Text, Editable )
- Give it the name Custom and an alias starting with $AutoPopulate followed by a number of your choice ( i.e. 9999)
- Save the subform
When you now create a new group, the “Auto Populate Method” field contains a new option … Custom. Magic, isn’t it ?
In fact it is not magic at all. When you open a group form in edit mode, the “Sub GenerateSubFormsList” in subform $GroupInheritableSchema reads all design elements and fills the “SubformsList” field with the names of all subforms starting with $AutoPopulate as an alias.
Then the following formula shows the subform according to the choice you make as an auto populate method
@If(AutoPopulate="" | AutoPopulate="0";"";"$AutoPopulate" + AutoPopulate)
That’s it, folks!
By the way, this is a great example of how to write code that allows enhancements without changing the code.