Hi,
In my hide\when formula on a field I have
(@Name([CN];@UserName) != app_SSADP | @Name([CN];@UserName) != app_me)
My name is in the app_me field and I can’t see the field. The person who’s name is in the app_SSADP field can see it ok. If I change the formula to just
@Name([CN];@UserName) != app_me
then I can see the field ok.
I’ve also tried
@Name([CN];@UserName) != app_SSADP:app_me
but still I can’t see it. Does anyone know where I’m going wrong?
Thanks in advance.
Subject: Why doesn’t hide\when read the second part of formula
Phil,
Change the OR to AND in your formula,
or (in my vew - even better):
Combine app_SSADP:app_me into one computed field, then use @IsMember/@IsNotMember.
HTH,
Simeon
Subject: Why doesn’t hide\when read the second part of formula
Peter, Ben and Simeon,
Thank you all for your help. Much appreciated. I will read your article Ben and you’re right, it’s easier to say it out loud.
Cheers,
Phil.
Subject: Why doesn’t hide\when read the second part of formula
how about this:Hide when:
@Isnotmember(@name([CN];@username);@Name([CN];App_me):@name([CN];app_SSADP))
This converts all names to common names, so it is not the best way, but should do what you want.
Subject: Why doesn’t hide\when read the second part of formula
See my article on Writing better hide-when formulas for some tips, but here is your basic problem, you need an &, not an | (or in English, an ‘and’, not an ‘or’) in the middle. To see why, try speaking aloud the hide-when formula:
(@Name([CN];@UserName) != app_SSADP | @Name([CN];@UserName) != app_me)
Hide me if the user name does not equal whatever is in app_ADP or if the user name does not equal whatever is in app_me.
So, if the value in app_SSADP=‘Ben Langhinrichs’ and the value in app_me=‘Phil Embleton’, then what happens when you, Phil Embleton, see the formula? The name does not equal the value in app_SSADP, so it hides. What you want is to hide when the name does not equal the value in app_SSADP AND does does not equal the value in app_me, so you need:
(@Name([CN];@UserName) != app_SSADP & @Name([CN];@UserName) != app_me)
Another option is to invert the logic and write a “show-me” type of formula and then do a not (or ‘!’) in fronmt of it, such as:
!(@Name([CN];@UserName) = app_SSADP | @Name([CN];@UserName) = app_me))
or more simply
!(@Name([CN];@UserName) = app_SSADP:app_me)
I hope that helps, and do read the article, as there are other hints that may help.