Executes a block of commands if the condition evaluates to true.
If cond
block1
[Else
block2]
EndIf
Where:
cond
Condition evaluated in the If.
block1
Block that is executed if the cond condition evaluates to true.
block2
Block that is executed if the cond condition evaluates to false.
Objects: Procedure, Transaction, Web Panel, Work Panel, Panel Work With for Smart Devices
Generators:
.NET,
.NET Framework,
Java, RPG, Cobol, Ruby (up to GeneXus X Evolution 3), Visual FoxPro (up to GeneXus X Evolution 3)
The If command allows you to condition the execution of command blocks.
Any command can be defined within block1 and block2 respectively.
If &del //&del is a boolean variable
DelCustomer(CustomerId) //DelClient is a Procedure and CustomerId is an attribute (with value in that context) sent by parameter
Else
Return
EndIf
When using this command in a Panel object or a Work With pattern and Work With object there is a restriction for the cond syntax. It can only contain a variable, attribute or SDT element of Boolean data type to be evaluated.