Ends the execution and returns to the caller program.
Objects: Procedure, Transaction, Web Panel, Panel for Smart Devices, Work With for Smart Devices
This command forces the running program to stop and return to the caller.
When the Return command is used within a For Each command, you must take into account that the database updates are performed immediately before the Endfor.
Consider the generic code given below:
att = value
Return //consider that if you define this, att is not updated in the database yet
When the condition is satisfied and the Return command is executed, the attribute is not modified at that moment in the database because the actual database update is performed just before the Endfor.
Below is a particular example to solve this scenario.
Consider the following Transaction object
And the following Procedure object:
Rule: Parm(in:&SupplierId, out:&Flag);
&Flag = 0
For each Supplier
where SupplierId = &SupplierId
SupplierReviewed = 'Y'
&Flag = 1
If &Flag = 1