Business Component samples

Once we did it, a Business Component data type named Attraction is automatically created in the KB. Then, we will be able to define in any object a variable based on the new data type.

Let's suppose we define the &Attraction variable based on the Attraction data type in a certain object (for example in a web panel, or other object) and we codify the following basic samples in the section of the object that corresponds (events, source, etc.):

The following code tries to load a certain Attraction record. If the operation fails because the record doesn't exist, the attraction is inserted. On the other hand, a category is assigned to the Attraction loaded:

From now on, let's asumme the Attraction transaction has 2 levels as the following image shows:

The second level allows to store the different possible tickets to visit each attraction (with different peculiarities, prices, etc.).

The transaction Business Component property was set with True value, so GeneXus has created the Attraction data type associated with the first level transaction. And since it is a 2-level transaction, GeneXus also has created the Attraction.Ticket data type associated with the lines (second level), which in this example corresponds to the attraction’s tickets.