Hi!
I hope somebody can enlighten me… what am I doing wrong?
I have a form with some fields I want hidden when the (current) user’s roles does not include “[SQA]” or “[SDSS]”.
I have a hidden computed checkbox (originally, this was supposed to be editable; since I could determine the user’s role via @UserRoles anyway, I decided to convert it to a computed field, which is hidden), named chkSDSS, which evaluates to “1” (the checkbox’s keyword’s synonym) if “[SQA]” or “[SDSS]” is a member of @UserRoles.
Code for chkSDSS:
@If(@IsMember(“[SQA]”;@UserRoles) | @IsMember(“[SDSS]”;@UserRoles); “1”; “”)
Now, the fields with hide-whens I mentioned earlier, have the following code in their hide-when formula box:
chkSDSS = “”
All of these codes worked fine when I was testing on my local database. The checkbox is checked when I assign the SDSS or SQA role to myself, and unchecked otherwise. The hide-whens worked perfectly, too.
As soon as I propagated this change to our test server (via Database > Refresh Design), however, the checkbox’s behavior has become unpredictable. Even the @If(@IsMember(“[SQA]”;@UserRoles) | @IsMember(“[SDSS]”;@UserRoles); “1”; “”) code is not working properly…
chkSDSS would be checked even if I’m not a member of either SQA or SDSS, or the other way around. sometimes, @UserRoles would return SQA or SDSS, even though I haven’t assigned any of those roles to myself; but chkSDSS is still unchecked…
Is there anything I missed?..
Thanks!