Official Content

If you want to generate and execute the application for the first time, you only have to press F5 (or select Build > Run from the main menu). 

GeneXus will evaluate the impact caused by your definitions in the Knowledge Base, and it will show a report under the name Impact Analysis.

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

When you read the report, you can see that the main title informs that “The 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 at the right window the physical changes that GeneXus proposes to make for each of those tables:

ImpactAnalysis_Gen_Web

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

ImpactAnalysis1_Gen_Web

Now observe that the Impact Analysis report is also informing 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 before), despite the fact that it is included it in the Product Transaction with the purpose of being shown in its form.

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 (still inexistent), as well as the tables with their structures in that database. Next, GeneXus executes those programs and after creating the database and the tables, it will generate all the necessary lines of code -in the selected programming language- to obtain the application that will enable the 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, and continuously you will see the application running:

DeveloperMenu_Gen_Web

You will see in your Web browser a simple page that offers a quick way to execute the defined objects.  This simple page, called Developer Menu, is for developers, as indicated by its name. Of course, it is not what users will view on screen.

Click on the ProductType link (or right-click and choose to open it in a new tab):

DeveloperMenuProductType_Gen_Web

The above page is displayed to allow the users to add, update and delete product types. Let’s enter the first product type.

Since the ProductTypeCode attribute has the Autonumber property set to True, the users will not have to enter a value for the identifier because it will be numbered automatically. So, enter the product type name: 

DeveloperMenuProductType1_Gen_Web

After entering the product type name and clicking on the Confirm button, a message will be displayed to inform that the data was added successfully; meanwhile, the form is cleared and is ready to enter another product type:

DeveloperMenuProductType2_Gen_Web

Enter the second product type:

DeveloperMenuProductType3_Gen_Web

Click on the Confirm button and then you can browse the data to confirm that they were numbered:

DeveloperMenuProductType4_Gen_Web

DeveloperMenuProductType5_Gen_Web

Now execute the Product Transaction. To do so, depending on the browser you are using, either you can select the back arrow of the navigator or else you can choose the navigator tab where the Developer Menu page is displayed, and then execute the Product Transaction:

DeveloperMenuProduct_Gen_Web

Try to add the first product:

DeveloperMenuProduct1_Gen_Web

You must indicate the product type. If you remember the product type code you can enter it, and another option is to select it from a list by clicking on the arrow.

DeveloperMenuProduct2_Gen_Web

Press the "Confirm" button to insert the product. 

Now, execute again the ProductType Transaction and try to delete the following product type:

DeveloperMenuDelete_Gen_Web

A message informs you that the deletion cannot be performed because related data exists in Product (the STAR muscular pain medicine is a product that belongs to this product type).

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