Official Content

Assigns a value depending on the evaluation of an expression. iif is an abbreviation for Immediate if.

Syntax

iif (Expression, TruePart, FalsePart)

Where:
Expression
    The returned value is of Boolean type. It is the expression you want to evaluate. Expression can be a formula, a Udp, etc.

TruePart
    Return value if the evaluation of Expression is True.

FalsePart
    Return value if the evaluation of Expression is False.

Scope

Objects: Procedure, Transaction, Panel, Web PanelData Provider
Generators: .NET, Java, Cobol

Samples

This example uses the iif function to evaluate if &PageName1 is not equal to &PageName2.

&PageNameChanged = iif(&PageName1 <> &PageName2, true , false)

It is exactly the same to:

if &PageName1 <> &PageName2
   &PageNameChange = 1
else
   &PageNameChange = 0
endif

See Also

If command

Last update: June 2025 | © GeneXus. All rights reserved. GeneXus Powered by Globant