Link to home
Start Free TrialLog in
Avatar of swell
swell

asked on

hide action if fieldname

hi experts,

i have a field name 'Condition' with 3 values, Healthy, Sick and Waiting. i just wanna show the action in the action bar in a document if the Condition is Sick.

i wrote the following formula in the hide when box:
Condition!='Sick'

this couldn't work. can someone please tell me the error.

tq. regards.
Avatar of Arunkumar
Arunkumar

Condition != "Sick"

Double Quotes buddy!
Arun,
Shoots and scores for a quick 20...
Make sure that the instant hiding of buttons when the choices could be made possible by checking the box "Automatically refresh Fields" in form, Refresh Fields in keywordChange" in the radiobutton field properties...

making sure that i get an "A" ;-)
Swell job.
C'mon Arun, you know that single quotes work, too!  Notes turns them immediately into double-quotes.
If the field is multi-value (e.g., checkbox), then you would want to use:

   ! Condition = "Sick"

As an example, if the field had two values, Sick & Waiting, then

   Condition != "Sick"
means
   "Sick" : "Waiting" != "Sick"
and is treated as equivalent to
   ("Sick" != "Sick") | ("Waiting" != "Sick")
...that is, != with multiple values on one side means NONE of the values matches, which is probably not be what you want when doing negative matching.

Whereas
   ! Condition = "Sick"
means
   "Sick" : "Waiting" = Sick
and is treated as equivalent to
   ("Sick" = "Sick") | ("Waiting" = "Sick")
...which is frequently what you do want when doing positive matching.
Wow I never knew that notes would convert them to double quotes!  Usually notes is so picky about that sort of thing.
If I want to check for one value in a list of values I usually use @IsMember or @IsNotMember in hide-when functions.
Advantage is that you can check if any of a list of values is in a list.
For example if you have roles defined in your database and you want to check if the user has any of some given roles to allow the button you'd write a formula like this:
@IsNotMember("[Admin]":"[System]"; @UserRoles)
will hide the button if the user has neither the role [Admin] or [System].
Avatar of swell

ASKER

thanx for the replies! gwalatee is right. notes did convert it to double quotes.i tested Arun's and gwalatee's solution and still couldn't hide it.

actually i have 2 formulas in the hide when box i.e.
Condition!="Sick";
@IsNotMember("[Admin]";@UserRoles)

i didn't know that we can only put 1 formula in the hide-when box, coz the 2nd formula works. (or something else is wrong?)
so at the end, i deleted the 2nd formula and the 1st formula works fine.

i wish i have more points to split to u guys for helping me, but i have little points left. thx.

good day

Ah, but you can combine more than one selection, you just have to use logical operators :
the pipe sign | means OR
and the ampersant sign & means AND
So if you want to hide the action if Condition!="Sick" OR the user doesn't have the Admin role, you use this:

Condition!="Sick" | @IsNotMember("[Admin]"; @UserRoles)

Regards,
JM aka jerrith
ASKER CERTIFIED SOLUTION
Avatar of Zvonko
Zvonko
Flag of North Macedonia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of swell

ASKER

Zvonko,

i think if u have 40000 points, probably 10 points mean nothing to you. but for starters like me, it'll probably take me 4 days to ask 1 question. but yah, nothing comes for free. glad you're amazed.
guess i was silly not reading the rules and regulations on rewarding points. thanx for answering my question.
No boy (or are you a girl?), this is not the correct way.

The points are exactly for that reason there to avoid the doing like you do: ask 100 questions for one point a question.

You did not take your time even to read this your question. Otherwise you would see that I did NOT answer your question.
But you expect that other people spend their valuable time to read your nonsense and work on for your solution.

And you poor man, you can have 40000 points every month, if you pay for it!

But you prefer to use EE resources for free and find some stupid geek working for your problems.

Rethink your attitude.

So long,
Zvonko

I think that if you read through the comments that my comment is your answer.
You asked about how to combine two conditions in one hide-when formula and I answered it for you.

If this is how you treat experts trying to find a solution for you, I think I'll just ignore your questions in future :(
The same is from my side. Now it is your turn "swell" to prove that you honor our efforts and our time helping you.

When it is visible that your attitude turned to good, then you can expect help from us.

Amaze me positive :-)

So long,
Zvonko

Well.. i did not understand anything.

:-(
Avatar of swell

ASKER

ok, i'm sorry, Zvonko. i took your remark as a sarcasm and took it too seriously. sorry. i over-reacted. i didn't mean it.

and i thought i clicked jerrith's answer instead of yours. really. i thanked you coz you still answer my question bout the total docs.

jerrith: sorry. i misclicked. i'll give you back the points.

hope apologies accepted.
I forgive you.
Do whatever get me the points without fail...Thanks.

-Jerrith.