Navigators

I have navigator that I need to have it open two different forms for Users that have different roles. When I try to put it on the hotspot that I have it doesn’t work it keeps opening two documents. Here is the code that I am using:

@If(!@UserRoles=“[Edit]”;@Return(@Prompt([Ok];“Error Message”;“You are Not Authorized to enter this area !”));@Do(@Command([Compose]; “Add Person”)))|

@If(!@UserRoles = “[EdmEdit]”; @Return(@Prompt([Ok]; “Error Message”; “Your are Not Authorized to enter this area!”)); @Do(@Command([Compose]; “Add Person2”)))

I only want it to open on or the other depending on the role that they have.

Any thoughts or ideas would be greatly appreciated. Thanks for the help

Christy DeKing

Subject: Navigators

The two @If statements are connected by an OR operator, so even if there are return statements, both parts of the OR will be evaluated. At least, if the first one is False, I’m not sure off hands, if @Formulas do a short-cut evaluation, but I’d suppose rather not.

What document do you want to create, if a user has both roles? If the [Edit] role takes precedence over the [EdmEdit] role, this might be what you want:

@If(

@UserRoles = "[Edit]";

@Return(@Command([Compose]; "Add Person");

@UserRoles = "[EdmEdit]");

@Command([Compose]; "Add Person2");

@Prompt([Ok]; "Error Message"; "Your are Not Authorized to enter this area!")

)

Subject: RE: Navigators

As I suspected, logical operators in @Formulas (and LotusScript) always evaluate all terms. You can either try it out yourself, or read

chapter 6.6. In fact, you should probably read the whole document, not just this chapter …

Subject: RE: Navigators

Thanks for the help I got it to work by using this formula

@If(!@UserRoles = “[EdmEdit]”; @Command([Compose];“Add Person2”);@Command([Compose];“Add Person”))

Again thanks for the help

Christy