IBM®
Skip to main content
    Country/region select      Terms of use
 
 
   
     Home      Products      Services & solutions      Support & downloads      My account     
 
developerWorks
AIX and UNIX
Information Mgmt
Lotus
New to Lotus
Products
How to buy
Downloads
Live demos
Technical library
Training
Support
Forums & community
Events
Rational
Tivoli
WebSphere
Java™ technology
Linux
Open source
SOA and Web services
Web development
XML
My developerWorks
About dW
Submit content
Feedback



developerWorks  >  Lotus  >  Technical Library
developerWorks



Tips from LDD

Simplifying hide-whens with @True and @False formulas

Tip submitted by
Mataprasad Agralwal


Level: Intermediate
Works with: Notes/Domoino
Updated: 03/03/2002

Related link:
More Tips from LDD


Using a specific example, this tip shows how to use @True and @False to simplify hide-when formulas that include more than one AND/OR conditions.

Our example includes two parts:
  1. Depending on whether or not the AND/OR conditions are met, a document shows or hides action buttons.
  2. Depending on whether or not the AND/OR conditions are met, a view selection formula shows or hides documents in a view.

In the first part of our example, we want to know whether or not the user is a member of a group allowed to approve documents. If so, then we want to show certain action buttons on a document to allow the user to approve the document. Add the following code to your form's action button hide-when formula:

var:=@If(@Ismember(@UserName;EditorsList) & FieldStatus="Approve";@True; @False);
var1:=@IF(OtherApproversComment !="" & @IsAvailable(RTF);@False;@True);
var2:=@IF(Approval="Yes" & SomeFlag="NO";@False;@True);

The condition is met if both var and var1 are true or if var2 is true. On the hide-when tab of the Action Properties box, add the following code:

@IF((var & var1) | var2;@False;@True);

Next, we want to tailor our view selection formula to evaluate to show only approved documents. Again, the condition for displaying the document in a view is met if both var and var1 are true or if var2 is true. Enter the following code in the view selection formula:

var:=@If(@Ismember(@UserName;EditorsList)AND FieldStatus="Approve";@True;
@False);
var1:=@IF(OtherApproversComment !="" AND @IsAvailable(RTF);@False;@True);
var2:=@IF(Approval="Yes" AND SomeFlag="NO";@False;@True);
var3 := @IF((var & var1) | var2;@True;@False);
Select (Form="This" | Form="That") & var3

This code filters the view documents like search parameters.


SUBMIT YOUR TIPS!
We encourage you to send us your tips (You can also click the "Would you like to submit a tip?" graphic below.) Your tips can be anything you've discovered about any Lotus product. The most important thing is that your tip be interesting, useful, or handy. And be sure to include complete information about how your tip works. For ideas, take a look at our tip archives. If we publish your tip, we'll send you the IBM Redbooks Lotus Collection on CD.






Would you like to submit a tip?
    About IBM Privacy Contact