Evaluates a condition; if the condition is True, Notes/Domino performs the action appearing immediately after that condition, and stops. If the condition is False, Notes/Domino skips to the next condition and tests it, and so on. If none of the conditions is True, Notes/Domino performs the else_action.
@If( condition1 ; action1 ; condition2 ; action2 ; ... ; condition99 ; action99 ; else_action )
condition
Expression that returns a Boolean. If this expression returns True, action is performed. If it's False, Notes/Domino skips to the next condition, if there is one. Otherwise, Notes/Domino performs else_action.
action
An action to be performed or a value to be returned if the governing condition returns True.
else_action
An action to be performed or a value to be returned if none of the conditions returns True.
In its simplest form, the If statement looks like this: @If( condition ; action ; else_action ).
You can list up to 99 conditions and corresponding actions, followed by just one action to be performed when all the conditions are False. As soon as a condition evaluates to True, Notes/Domino performs the associated action and ignores the remainder of the @If statement.
Notes/Domino accepts the form @If( condition ), with only one condition and no action, but does not perform any action based on the condition.
If you compare a field to a value (for example, Year > 1995) and the field is unavailable, the comparison is False. However, you should check for fields that may not be present with @IsUnavailable.
@If(CostOfGoods>=12.45;"Over Budget";"Bill of Materials OK")
@If(CostOfGoods>=12.45;"Over Budget";"")
@If(CostOfGoods>12.45;"Over Budget";CostOfGoods<12.45;
"Bill of Materials OK";"Estimate Right on Target")
@If(@IsNewDoc; NewNoteTitle; @ViewTitle =
"Author View"; ByAuthorTitle; StandardTitle)
@If((contactMe="Yes") & (@ThisValue = "");@Failure("You must enter a value in " + @ThisName);@Success)
Using @ThisValue and @ThisName instead of hard-coding in field names enables you to copy and paste this code into all the other fields you want to require input for, the firstName and lastName fields, for example.
If...Then...Else statement of LotusScript® language
If...GoTo statement of LotusScript language
If...Then...ElseIf statement of LotusScript language