Official Content

Indicates whether the end user will type a value that corresponds to a code/identifier or the description associated with the value (and the code will be automatically obtained).

Values

Values The end user will enter a value that corresponds to a code/identifier. This is the default value.
Descriptions The end user will enter a description and the associated code/identifier will be automatically obtained.

Scope

Generators: .NET, .NET Framework, Android, Angular, Apple, Java
Level: Attribute, Variable

Description

Instead of forcing end users to handle codes, they can work with the descriptions that contain the semantic meaning. For example, they can type a CountryName and its CountryId can be automatically retrieved.

To achieve this for the attribute/variable for which you want to provide this functionality (for example, the CountryId attribute in a Transaction object or a &CountryId variable in a Web Panel object among other possibilities), first, you have to set its InputType property to Descriptions.

After that, for the same attribute/variable (CountryId / &CountryId):

  • The Item Values property must be set to CountryId (this will be assigned by default).
  • The Item Descriptions property must be set to CountryName.

Thus, on the screen, the CountryId attribute will be “disguised” as CountryName. End users will see a field to type/select a CountryName, but the attribute is not CountryName. On the contrary, it is the CountryId attribute. 

When an end user writes “Uruguay”, an internal search is performed to retrieve the code that corresponds to "Uruguay". That value (for example: 1) is stored in the CountryId attribute. This is totally transparent for the end user.

Considerations

There must be a bi-univocal relation between the code (or identifier) and the description. That is, for each description, there will be only one associated code. In the example, there can't be more than one country with the same name and a different identifier, because if there were, it would be impossible to perform the match. In other words, the attribute that stores the descriptions must be a Candidate Key of the table, that is, there must be a unique index for the CountryName attribute. When the candidate key doesn't exist, the following warning will be shown:

Spc0107 Candidate Key CountryName for CountryId may have duplicated values.

At runtime, if the end user selects a duplicated value (for which there is more than one CountryId) a “Country is ambiguous” error will be given, as it will not know which to choose.

Note: This property is not available for formula attributes.

Runtime/Design time

This property applies only at design time.

See Also

Suggest property

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