Official Content

Before generating and running the application, note that when the Knowledge Base (KB) was created, the default options were left as suggested (to prototype the application locally using .NET and SQL Server):

GeneXusNext-NewKBDialog

Therefore, the Default Data Store properties were set by default (pointing to the sqlserver of the sql-1 container) to establish the connection with the database server.

GeneXus Next - Default Data Store

First execution and Impact Analysis

Press F5 or select Build > Run from the main menu. GeneXus Next will evaluate the impact caused by your definitions in the Knowledge Base, and it will show a report called Impact Analysis.

This report shows which structural changes must be made in the database.

In the report, you will see that the main title says “Database needs to be reorganized”. The term “reorganize” always refers to the task of making changes in the database structure.

By clicking on each Table (ProductType and Product in the left window), you will see in the right window the physical changes that GeneXus proposes to make for each of those tables. 

Note that the Impact Analysis report informs that the ProductType physical table is new. That is, it must be created containing the ProductTypeCode (primary key) and the ProductTypeName attributes.

GeneXus Next Impact analysis - running for the first time

In addition, note that the Impact Analysis report also says that the Product physical table is new. So, it must be created including all the attributes declared in the Product Transaction object except the ProductTypeName attribute (as explained in Defining the First Objects), even though it is included in the Product Transaction to be shown in its form.

GeneXus Next Impact analysis - running for the first time - Product transaction

If you agree with the Impact Analysis proposal, you can click on the Reorganize button, and GeneXus will start creating the programs needed to create the database (which doesn't exist yet), as well as the tables with their structures in that database. Next, GeneXus will execute those programs and after creating the database and the tables, it will generate all the necessary lines of code —in this example, in .NET— to obtain the application that will enable users to insert, update, and delete product types and products.

You are then informed if the result was successful or if there were any errors or warnings.

After the reorganization, the Launchpad is displayed showing the generated objects to start interacting with the database:

GeneXus Next - Launchpad - Running Product and ProductType Trns

Click on ProductType, and a page will open in your browser allowing users to add, update, and delete product types.

GeneXus Next - ProductType - application running

Enter the first product type.

GeneXus Next First product type added

After entering the product type, click on the CONFIRM button. A message will be displayed to inform that the data was added successfully; meanwhile, the form is cleared and ready to enter another product type.

Now execute the Product Transaction and add a product indicating its product type.

If you remember the product type code you can enter it. Another option is to select it from a list by clicking on the arrow symbol.

GeneXus Next - Product added - running the app

Press the "CONFIRM" button to insert the product. 

Now, execute the ProductType Transaction again and try to delete the Cosmetics Product Type:

GeneXus Next - Product Type deleted

A message informs you that the deletion cannot be performed because there is a product that belongs to this product type.

Last update: December 2024 | © GeneXus. All rights reserved. GeneXus Powered by Globant