I want to assign a group name to a readers field.Today there are 15 groups and tomorrow they may come with adding another group to the ACL.So I want to put the starting name of the group as Group.i.e the group names will be GroupA,GroupB etc. If "Group"string is found then I will take the full group name(for ex GroupA) and assign it to readers field.
Not sure whether I can achieve this or not? I can’t change my domino directory names.nsf so that I can add a hidden view to find out this group!!!Otherwise I could have achived this easily!!
Subject: How to iterate through a text list in Domino version 5?
You can do exactly what you’re describing here with LotusScript and the NotesACL and NotesACLEntry classes. In fact, it looks like you can do it without forcing your group names to contain the string “Group” too. The NotesACLEntry class has a property called “IsGorup” that indicates whether an ACL entry is a group or not. LotusScript would also give you the kind of looping control you’re looking for. I don’t know of anyway to do the looping you want to do in @Formula in R5, but perhaps there are @Formula experts out there who can correct me.If you’ve never worked with LotusScript before, maybe this is a good time to start. In the end, you’ll have much more control over what you’re trying to do and the code will be more maintainable. Keil.
Subject: RE: How to iterate through a text list in Domino version 5?
Hi KeilThanks for the response. Yeah I know Lotus Script!Just wondering if anybody has a sinple solution with Formula.May be i should go with Lotus Script!!!.
Subject: How to iterate through a text list in Domino version 5?
You know, we got along just fine WITHOUT loops in Formula Language for quite a while. If you’re used to thinking in languages that require loops, it will look like you need a loop. You really aren’t thinking in Formula Language unless you are thinking in LISTS.
What you’ve described can be done in R5 Formula Language with a formula like this:
namesList := @UseNamesList;
backList := @Trim(@Right(namesList; "Group);
@If(backList = “”; “”; “Group” + backlist)
Let’s take a look at how that works. Say @UserNamesList returns something like this:
“CN=Stan Rogers/OU=Dev/O=Essellar”
“Stan Rogers”
“*”
“*/Essellar”
“*/Dev/Essellar”
“GroupDevelopers”
“GroupAdmins”
“[Admin]”
Two of those values contain the string “Group”. When you do the @Right, you will wind up with the values to the right of “Group” in each entry:
Subject: RE: How to iterate through a text list in Domino version 5?
Stan, it’s a sickness for you to be able to think that way ;). I write so much LS I’ve really lost the ability to write complex @Formula code (though your example isn’t all that complex). Thanks for showing us how to do that. Thanks for the great explanation of how it works too.