Executes the equivalent to the delete button in a Transaction Form.
Is a variable defined in a GeneXus object, based on a Business Component.
When this method is executed, the data previously loaded into memory by using the Load method (*) is deleted, but only if the referential integrity doesn't fail and if error rules don't occur.
(*) This is indispensable, as the data to be deleted must be previously instantiated.
Suppose you define the following Transaction as Business Component (by setting its Business Component property = True):
CustomerId* (Autonumber property = True)
Error("The customer can't be deleted because he has miles to use") if delete and CustomerTotalMiles>0;
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. Thus, in any object, you can define a variable named &Customer based on the Customer type.
The following code (defined for example in a Procedure Source or inside an Event in a Web Panel object) tries to delete the customer whose Primary Key CustomerId=25:
This method is available since GeneXus 9.0
Error handling in Business Components