Académique Documents
Professionnel Documents
Culture Documents
TRADEMARKS
ARTech GeneXus are trademarks or registered trademarks of ARTech Consultores S.R.L.
All other trademarks mentioned herein are property of their respective owners.
Page 2 of 47
Getting Started with GeneXus
Content
Introduction .................................................................................................................... 4
Objectives .................................................................................................................... 4
System Requirements....................................................................................................... 4
Generator Requirements ................................................................................................ 5
Trial Version Limitations .................................................................................................... 6
Installation and Setup....................................................................................................... 7
Setup Wizard ................................................................................................................ 7
Trial Version Authorization................................................................................................. 9
Getting Started Step by Step ............................................................................................10
Step 1: Creating a Knowledge Base................................................................................10
Step 2: Creating an Object in GeneXus...........................................................................10
Step 3: Defining Attributes for the Object Transaction Invoice............................................11
Step 4: Viewing the Completed Objects Form ..................................................................12
Step 5: Defining Formulas in GeneXus............................................................................13
Step 6: Inserting a Business Rule ..................................................................................15
Step 7: Reviewing the Database after Creating the Invoice Object ......................................16
Step 8: Creating a Customer Object ...............................................................................18
Step 9: Viewing Table Structure Changes........................................................................19
Step 10: Prototyping your Application in Visual Basic with Microsoft Access..........................20
Step 11: Viewing the Database Creation Report ...............................................................22
Step 12: Creating the Tables with the Database Manager ..................................................23
Step 13: Specifying and Generating your Code ................................................................24
Step 14: Running your Application .................................................................................26
Step 15: Adding New Objects to your Project: Item Transaction .........................................27
Step 16: Viewing Table Structure Changes ......................................................................29
Step 17: Impacting the Database ..................................................................................29
Step 18: Refactoring the Data and Generating the Programs .............................................30
Step 19: Running your Application .................................................................................32
Step 20: Creating a Report & Making a Call to It ..............................................................32
Step 21: Specifying and Running your Application ............................................................36
How to Move your Application to .NET and JAVA ...............................................................38
Step 1: Deploying your Application to .NET with Microsoft SQL Server.................................38
Step 2: Viewing the .NET Application Running .................................................................42
Step 3: Deploying your Application to Java with Microsoft SQL Server .................................42
Step 4: Viewing the JAVA Application Running .................................................................46
Online Resources ............................................................................................................47
GeneXus Community ....................................................................................................47
Support ......................................................................................................................47
How to Buy .................................................................................................................47
Page 3 of 47
Getting Started with GeneXus
Introduction
Objectives
The objectives of this document are that you:
• Discover the power of knowledge-based development
• Experience the key features of GeneXus:
o Knowledge-based design
o Automatic code generation
o Automatic database and code maintenance
o Multi-platform deployment
System Requirements
GeneXus Trial includes the following products:
• Development Environment
It is an Integrated Development Environment (IDE) for designing and prototyping your
applications, regardless of the production platform.
• Generators
GeneXus generates native code for the leading platforms. The generators available are the
following:
• .NET
• Java
• Visual Basic
Below is a list of the hardware and software you will need in order to run GeneXus and the
applications generated by it.
1
The .NET Framework 1.1 Redistributable Package can be downloaded from Microsoft’s website:
http://msdn.microsoft.com/library/default.asp?url=/downloads/list/netdevframework.asp.
It can also be downloaded from the Download Center at GXTechnical website:
http://www.gxtechnical.com/main/hdcenter.aspx?2,5,36,1035
Page 4 of 47
Getting Started with GeneXus
Generator Requirements
This section contains the requirements to generate and execute applications with the different
GeneXus generators:
Generator Requirements
.NET • Microsoft .NET Framework 1.1 Redistributable Package 2
• For generating Web interface applications you will need IIS 5.0 or higher
(available on Windows 2000 or XP)
• For generating Windows interface applications or printing PDF reports,
you will need Visual J# Distribution Package 1.1 3
• ODBC Driver for the DBMS used
Java • Sun and/or Microsoft JDK (we recommend having both)
• For generating Web interface applications:
o Web Server
o Servlet Engine
o JavaServer Web Development Kit
• For generating 3-tier Windows interface applications:
o HTTP: you will need a Web server and a servlet engine
o CORBA: you will need Visibroker
• JDBC Driver for the DBMS used
Visual Basic • Microsoft Visual Studio 6.0, with Service Pack 5 or higher
• MDAC 2.6 or higher
• If you use Sheridan Data Widgets, you will need version 3.0 or higher
installed
• ODBC Driver for the DBMS used (except if you are working with Microsoft
Access)
In addition, to create the database and execute the generated applications, you must have some
of the following DBMSs installed:
Generator DBMS
.NET • DB2 Universal Database
Java • DB2 UDB for iSeries
• Informix
• Oracle
• PostgreSQL
• SQL Server
Visual Basic • Access
• DB2 Universal Database
• DB2 UDB for iSeries
• Informix
• Oracle
• PostgreSQL
• SQL Server
2
The .NET Framework 1.1 Redistributable Package can be downloaded from Microsoft’s website:
http://msdn.microsoft.com/library/default.asp?url=/downloads/list/netdevframework.asp.
It can also be downloaded from the Download Center at GXTechnical website:
http://www.gxtechnical.com/main/hdcenter.aspx?2,5,36,1035
3
You can obtain Visual J# Distribution Package 1.1 from Microsoft’s website:
http://msdn.microsoft.com/vjsharp/downloads/howtoget/default.aspx
Page 5 of 47
Getting Started with GeneXus
It is not possible to open a knowledge base developed with GeneXus standard version from
GeneXus Trial or vice versa.
Support for GeneXus Trial is limited. If you have any doubts or problems –about version
installation and activation only–, please send an e-mail to gxtrial@genexus.com. For any
additional information, we recommend contacting your local distributor
(www.genexus.com/distributors).
Page 6 of 47
Getting Started with GeneXus
1. Start Windows.
2. Run GeneXus Trial Setup.
3. Follow the Setup Wizard instructions to install the selected products (Development
Environment and Generators).
Setup Wizard
The first screen you will come across is the setup wizard welcome screen: click Next if you wish
to continue with the installation.
The following screen is a License agreement that you should read carefully before continuing to
the next one. After selecting the I accept the License Agreement option and clicking Next,
the following dialog asks you to register your name and company name. Once you have entered
that information, click Next to display the following dialog box:
In this dialog you select the destination folder where GeneXus will be installed (a directory called
gxw80Trial is suggested). By clicking the Browse button you will be able to change the default
one. Click Next to go to this dialog:
Page 7 of 47
Getting Started with GeneXus
Once you have selected the destination folder, you will be asked for the products you want to
install (i.e. Development Environment and the different Generators). Then, click Next to begin
the installation.
After all the files you need have been copied to your system, the Setup program places GeneXus
icons in a GeneXus group that will be automatically incorporated to your Program Manager's
window.
Page 8 of 47
Getting Started with GeneXus
1. Execute GeneXus 8.0 Trial Version from the desktop shortcut for GeneXus 8.0 or from the
programs menu.
4. After receiving the activation key, proceed with the product activation. Then you will be able to
start using GeneXus Trial.
Page 9 of 47
Getting Started with GeneXus
Page 10 of 47
Getting Started with GeneXus
Page 11 of 47
Getting Started with GeneXus
When defining a Transaction, a default Form is automatically created by GeneXus to specify the
way the end user will access data in Windows applications. This form can be changed by the
developer.
Page 12 of 47
Getting Started with GeneXus
When defining a Transaction, a default Web Form is automatically created by GeneXus to specify
the way the end user will access data in Web applications. This Web Form is based on a default
Theme object, which is a new object introduced in the latest GeneXus version.
The Theme object improves the development and maintenance of Web applications by separating
the developer’s work from the designer’s.
4
Note: Most likely you will want to read the tax % from a table, but in this example we will just hardcode
the tax % for simplicity.
Page 13 of 47
Getting Started with GeneXus
1. Choose the Line Total attribute (ItemLnTot) and double-click the Formula field.
Page 14 of 47
Getting Started with GeneXus
1. Select the
Rules tab.
5. Click Save.
Page 15 of 47
Getting Started with GeneXus
3. In the Select Object dialog box, click Select All and then click OK.
Page 16 of 47
Getting Started with GeneXus
You can see that GeneXus automatically normalizes the tables, and creates two tables to
support the Invoice object, Header & Detail: Table Invoice and Table Invoice1 (marked in the
image above), with the following structure:
<Invoice> <Invoice1>
InvoiceId InvoiceId
InvoiceDate ItemId
CustomerId ItemDsc
CustomerNm ItemPrice
ItemQty
In addition, you will see that GeneXus automatically removes from the tables those attributes
that we made as formulas, and makes them global formulas so you can access them
automatically anywhere.
Note: From the Menu: Advanced \ Table you can change a table name, add new indexes, or
define redundancies.
Page 17 of 47
Getting Started with GeneXus
Note that when you press the “Save” button GeneXus will ask the attribute definition for the
CustomerAddress and the CustomerEmail. That is because the CustomerName and CustomerId
were defined before.
After you have added a new Customer object and inserted the attributes into the structure, the
Customer object will be created and its Structure and Forms will look as follows:
Page 18 of 47
Getting Started with GeneXus
Page 19 of 47
Getting Started with GeneXus
1. Select Prototype.
3. Click OK.
Page 20 of 47
Getting Started with GeneXus
6. Click Next.
8. Click Next.
Page 21 of 47
Getting Started with GeneXus
After you click this button, GeneXus will generate all the code to create the database. Then it will
compile the code so that you can execute the reorganization program.
Page 22 of 47
Getting Started with GeneXus
2. Click Exit.
Page 23 of 47
Getting Started with GeneXus
1. On the Build menu, click Build All. You can also click Build All in the GeneXus toolbar.
GeneXus presents you with a specification report for each program it will generate.
The specification report’s objective is to show you in a high level how the program will execute,
which tables it will access and which operations it will perform.
In this case you are viewing the specification report of the transactions; notice that transactions
are programs that will enable the user to Insert, Update, and Delete functions on the database.
It also ensures that referential integrity and record locking are handled.
Page 24 of 47
Getting Started with GeneXus
GeneXus automatically takes charge of referential integrity. That is, transactions have the
necessary knowledge to avoid data inconsistency due to updates (for example, a parent with
children has been deleted, or a child without a parent has been entered).
However, an integrity check alone would not be enough because a check failure and a "Client
does not exist" message would not be useful for the user. It is necessary to help the user find
the valid values!
For this reason, GeneXus not only provides integrity controls, but also creates Prompt type
objects that give the user a set of valid values to choose from.
Although the Prompts are initially created by GeneXus, they can be modified by the user.
Page 25 of 47
Getting Started with GeneXus
Page 26 of 47
Getting Started with GeneXus
4. Next, enter some data into the Invoice. You will notice a couple of things here:
2. Create the Item Transaction by following Steps 2 to 4. The following attributes will be inserted
in the Item Transaction Structure:
Note that when you press the Save button, GeneXus won’t ask for the attribute definition of any
of them.
Page 27 of 47
Getting Started with GeneXus
3. Now click the Form and Web Form tabs to see the transaction’s windows and Web forms,
respectively.
Page 28 of 47
Getting Started with GeneXus
Reviewing the Database after the Item Object has been created allows you to see that GeneXus
automatically normalizes the tables for you. You will see that GeneXus has automatically moved
the ItemDsc and ItemPrice attributes from the Invoice1 (Invoice Detail) table to the Item Table.
You will see that GeneXus automatically moves the attributes from the InvoiceHeader to the Item.
Page 29 of 47
Getting Started with GeneXus
Page 30 of 47
Getting Started with GeneXus
Page 31 of 47
Getting Started with GeneXus
1. Follow Step 2 to
create the new
Report object, but
this time click on
Report and type
Invoice in the
Name field.
Page 32 of 47
Getting Started with GeneXus
Page 33 of 47
Getting Started with GeneXus
The Layout tab contains the output to be printed later, and each one of them can have a set of
controls such as attributes, variables, labels, etc.
Page 34 of 47
Getting Started with GeneXus
The navigation structure (which data is going to be listed, and in what order) is defined in the
Source tab. To this end, a very simple procedural language is used.
In order to make the communication between the two objects we will make a call from the Invoice
Transaction to the Invoice Report.
6. Write
“parm(InvoiceId);”
7. Click Save.
Page 35 of 47
Getting Started with GeneXus
Note: After(TRN) is a GeneXus function; to read about it press CTRL + “U”, scroll to the bottom,
highlight “After(TRN)” and hit the Help button.
Page 36 of 47
Getting Started with GeneXus
CONGRATULATIONS…, you have successfully created an Invoice application in GeneXus; our next
step is to show you how to move your application to another platform, .NET and/or JAVA.
Page 37 of 47
Getting Started with GeneXus
5. Click Next.
7. Write the name of the Database and the Server. In the example, the Database name is
“demo” 5 and the Server name is “(local)”
8. Click Next.
5
The creation of the database is not performed by GeneXus when the creation process is carried out, so the
database must be created manually before GeneXus actually creates the database tables. Please refer to
your SQL Server manual for information on how to create the database.
Page 38 of 47
Getting Started with GeneXus
6
The user needs CREATION rights to the database tables. For simplicity, we recommend assigning OWNER
rights.
Page 39 of 47
Getting Started with GeneXus
Page 40 of 47
Getting Started with GeneXus
Page 41 of 47
Getting Started with GeneXus
Figure 61 Invoice
Page 42 of 47
Getting Started with GeneXus
5. Click Next.
7. Click Next.
7
The database is not created by GeneXus when the creation process is performed, so you must create the
database manually before GeneXus actually creates the database tables. Please refer to your SQL Server
manual for information on how to create the database.
Page 43 of 47
Getting Started with GeneXus
8. In Step 3, enter the user id and password for the DBMS login. In the example the User Id is
“user_name” 8
8
The user needs CREATION rights to the database tables. For simplicity we recommend assigning OWNER
rights.
Page 44 of 47
Getting Started with GeneXus
Remember that before executing you must compile the code, with the Compile button
Also remember to start the Servlet Server.
20. Execute the JAVA application, and then the Invoice Transaction.
9
In the example:
• Compiler Path = C:\Program Files\Microsoft SDK for Java 4.0\bin\jvc.exe
• Make Path = C:\Program Files\Microsoft SDK for Java 4.0\bin\nmake.exe
• Interpreter Path = C:\WINDOWS\system32\jview.exe
• Classpath = gxclassr.zip;.;C:\resin-2.1.7\lib\jsdk23.jar;C:\jdbc\sqlserver\Una2000.jar
• Web Application Base URL = http://localhost:8080/servlet/
Page 45 of 47
Getting Started with GeneXus
Figure 66 Invoice
Page 46 of 47
Getting Started with GeneXus
Online Resources
GeneXus Community
The GeneXus Community provides a variety of ways to get answers to your questions, solutions to
your problems, and to share your own expertise. Find the list of community resources available to
you at:
www.genexus.com/community
Support
ARTech offers a wide range of support services and resources:
• Self-Service Online Support
These resources are available to anyone online. However, the information that you access
depends on your GXTechnical Access Level.
• Interactive Support Services
Interact with other members of the Community and with our Support Team.
www.genexus.com/support
How to Buy
The GeneXus Technologies are sold through a network of distributors worldwide.
Page 47 of 47