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
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!")