Use formula for choices and userrole

NotesClient application. I have a checkbox type field in a form. I am using “Formula for choices” and trying to display different choices bases on a role. My code is

@If(@IsMember(“[Legal]”;@UserRoles);

“Choice 1 | C1” :

“Choice 2 | C2” :

“Choice 3 | C3” ;

“Choice 1 | C1”:

“Choice 2 | C2”)

I would expect that if the user has the [Legal] role, then three choices would display. Only two choices display when the [Legal] role is assigned or when it is not assigned.

Any help would be appreciated.

Subject: Use formula for choices and userrole

use this

@explode( “Choice 1 | C1 : Choice 2 | C2 : Choice 3 | C3”; “:”) ;

Subject: RE: Use formula for choices and userrole

Thanks for the response. It worked differently, but still not what I want. If I change the code to

@If(@IsMember(“[Legal]”;@UserRoles);

@Explode(“Choice 1 | C1” :

“Choice 2 | C2” :

“Choice 3 | C3”; “:”) ;

“Choice 1 | C1”:

“Choice 2 | C2”)

then 3 choices are displayed whether the legal role is assigned or not.

If I change the code to

@If(@IsMember(“[Legal]”;@UserRoles);

@Explode(“Choice 1 | C1” :

“Choice 2 | C2” :

“Choice 3 | C3”; “:”) ;

@Explode(“Choice 1 | C1”:

“Choice 2 | C2”; “:”))

then only two choices are displayed whether the [Legal] rolie is assigned or not.

I need all 3 choices to display when the [Legal] role is assigned and only 2 choices to display when it is not assigned.

Subject: Use formula for choices and userrole

Your code looks good to me. The only thing I think you need to do is to make sure that you have checked the box “Enforce a consistent Access Control List accross all replicas” in the ACL / Advanced window.

Good luck.

Subject: Use formula for choices and userrole

  1. Are you sure that the role name is spelled and capitalized correctly?2. Are you sure that the role assignment has taken effect when you’re testing? You need to close all sessions with a database before ACL changes take effect. Use the Notes client’s Security button (in the taskbar) to verify your assigned roles when testing.

  2. Is the test database on a local workstation, where the @userroles function will return “” (if you’re not enforcing a consistent ACL)?

Subject: RE: Use formula for choices and userrole

Item 2 was the problem. I still had the database bookmarked in designer. Even though I did not have any design elements open, that must have been the problem. Once I removed the bookmark from designer, it worked like it was supposed to.

Thanks for your help/

Subject: Another trick is to hit F5; that should close all open sessions, too.