FAQs - GeneXus Core course (v18)
-
Transactions
-
-
Hide an attribute in the Web layout
-
Error in Data Provider associated with a Transaction (data loading process): Attribute does not have the "visible" property
-
Error in global formula: reference to the same attribute to which the formula is associated: Formula XXX (directly or indirectly) references itself
-
-
Pattern Work With and Transactions
-
Subtype Groups
-
Procedures
-
GeneXus Server
Autonumbering the second level of a transaction
Since the Autonumber property can only be applied to simple primary keys, the Serial rule must be used to number a second level.
This rule requires you to create an attribute at the first level of the transaction, which will store the last value assigned to the second level lines.
Let's see this with an example.
Suppose we have the following two-level transaction to handle the countries and their cities:
The physical table generated from the second level of that transaction is COUNTRYCITY, which is made up of:
It is important to note that the primary key of the table generated from the second level is a compound key (made up of CountryId and CityId).
If we autonumber CityId, we would only be autonumbering part of the table key, and for this reason GeneXus displays a Warning to inform about this.
This is why GeneXus offers the option to autonumber a second level with the Serial rule.
To do so, add the following rule to the Country transaction:
Serial(CityId, CountryCitySerial, 1);
CityId is the attribute to autonumber, CountryCitySerial is a new numeric attribute of the Country transaction first level that saves the last entered city identifier, and 1 is the desired increment between records.
You can access the complete documentation from the following link:
https://wiki.genexus.com/commwiki/servlet/wiki?6866,Serial%20rule
This rule requires you to create an attribute at the first level of the transaction, which will store the last value assigned to the second level lines.
Let's see this with an example.
Suppose we have the following two-level transaction to handle the countries and their cities:
The physical table generated from the second level of that transaction is COUNTRYCITY, which is made up of:
It is important to note that the primary key of the table generated from the second level is a compound key (made up of CountryId and CityId).
If we autonumber CityId, we would only be autonumbering part of the table key, and for this reason GeneXus displays a Warning to inform about this.
This is why GeneXus offers the option to autonumber a second level with the Serial rule.
To do so, add the following rule to the Country transaction:
Serial(CityId, CountryCitySerial, 1);
CityId is the attribute to autonumber, CountryCitySerial is a new numeric attribute of the Country transaction first level that saves the last entered city identifier, and 1 is the desired increment between records.
You can access the complete documentation from the following link:
https://wiki.genexus.com/commwiki/servlet/wiki?6866,Serial%20rule