ianmcalder
asked on
Hide when Formula required for a button in Lotus notes
Hello,
Hoping for some help with a hide when formula below which sits behind a "Approve" button within a workflow document.
-------
Current Hide when
Assign = ""|
@LowerCase(Assign) !=@LowerCase((@Name([CN];@ UserName))) |
Status_K!=NULL
-----
This formula works OK for a single user in the "Assign" field which is on the form however when there are multiple entries seperated by a semi colon i.e one of five people can approve the button remains hidden.
Not quite sure on how to do this in a formula argument . In english it would be something like :
if a your name is one of many listed in the assign field seperated by a semi colon then unhide the button.
The answer can not be use a role as the assign field is dynamic i.e depending on who you are you will have different approvers.
Hoping you can help.
Thanks
Hoping for some help with a hide when formula below which sits behind a "Approve" button within a workflow document.
-------
Current Hide when
Assign = ""|
@LowerCase(Assign) !=@LowerCase((@Name([CN];@
Status_K!=NULL
-----
This formula works OK for a single user in the "Assign" field which is on the form however when there are multiple entries seperated by a semi colon i.e one of five people can approve the button remains hidden.
Not quite sure on how to do this in a formula argument . In english it would be something like :
if a your name is one of many listed in the assign field seperated by a semi colon then unhide the button.
The answer can not be use a role as the assign field is dynamic i.e depending on who you are you will have different approvers.
Hoping you can help.
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
One small suggestion, instead of
!@IsMember
use
@IsNotMember
It sounds better:
"Hide when current user is not member of the field Assign"
@IsNotMember( @LowerCase( @Name( [CN]; @UserName ) ); @LowerCase( @Name( [CN]; Assign ) ) )
!@IsMember
use
@IsNotMember
It sounds better:
"Hide when current user is not member of the field Assign"
@IsNotMember( @LowerCase( @Name( [CN]; @UserName ) ); @LowerCase( @Name( [CN]; Assign ) ) )
mbonaci: well.. if we go with tips: my all time best tip is to form the formula to "Show when" and put !( ) around it...
cause with this technique it's much easier (usually) to get the right formula, basically sjef_bosmans approach, which also lacks the last line: which would be "hidewhen"; (cause, obviously the last line is simply an assignment from showwhen to hidewhen, but the formula wouldn't know what to do with it and would basically always result return a "No main or selection expression in formula"
cause with this technique it's much easier (usually) to get the right formula, basically sjef_bosmans approach, which also lacks the last line: which would be "hidewhen"; (cause, obviously the last line is simply an assignment from showwhen to hidewhen, but the formula wouldn't know what to do with it and would basically always result return a "No main or selection expression in formula"
I merely explained mathematical logic, and I made all the intermediate steps... Of course it can all be written as one statement, as you suggested, using parentheses and without the 'variables', but that was beside my point.
ASKER
Thanks for your efforts !!!
ismember:= @LowerCase(@Name([CN];@Use
isstatusok:= Status_K!=NULL;
showwhen:= ismember & isstatusok;
hidewhen:= !showwhen;
By the way, what is NULL? In formula language it doesn't exist, so it's assumed to be a variable without a value, probably with an empty string value. Hence it works. But someone evil could assign a value to NULL, e.g. NULL:= "0" and your formula will stop to work. Theoretically speaking of course...