Evaluates whether the execution of the Save, Check, Load or Delete methods,succeeded or not.
It returns True if the operation was successful. Otherwise, it returns False.
Is a variable defined in a GeneXus object, based on a Business Component.
Suppose you define the Customer Transaction as Business Component (by setting its Business Component property = True):
CustomerId* (Autonumber property = True)
error('The customer must be 18 years old or more') if CustomerBirthDate.Age()<18;
Accordingly, a Business Component data type of the Customer Transaction is automatically created in the Knowledge Base and you can define a variable of the new type created in any object.
You can define a variable named &Customer based on the Customer type in any object.
The following code (defined for example in a Procedure Source or inside an Event in a Web Panel object) tries to insert a customer younger than 18 years old:
&Customer.CustomerAddress='18001 Collins Avenue'
&Messages = &customer.GetMessages()
for &oneMessage in &Messages
Variables defined in this object:
- &messagges: Messages data type (collection)
- &onemessage: Messages.message data type (1 element of the messages collection)
When the Success method is evaluated, it returns False because the error rule was triggered and the save wasn't successful, so the code included in the else, will be executed.
Available in Android since GeneXus 17 upgrade 4.
Error handling in Business Components
Business Components Methods