Official Content

Indicates a range of valid values for attributes, variables, domains, or SDT members to prevent end users from entering invalid values.

Scope

Level: Attribute, Domain, SDT member, Variable

Description

The verification of whether a value is within the established range is done at runtime when the value is entered through a form (when entering the value and leaving the field).

When an assignment is performed by code, the value is not validated against the specified range. It is taken into account when the value is to be saved in the database.

If the validation of an entered value fails, an error message is automatically generated, indicating "%1 is out of range" (%1 is replaced by the name of the attribute).

Considerations 

1) This property is not available when the attribute is a formula, or when the attribute, variable, or SDT member is based on the Date data type.

2) Value Range Edition

In most cases, you can edit and change the default Value Range property, even if it is calculated automatically (inherited from a domain or subtype). In Enumerated Domains, however, this value can't be modified even though the Value Range is also calculated automatically.

Syntax

<ValueRange> ::= <Range> | <Value> [<ValueRange>]
<Range>      ::= <FromValue> ":" <ToValue>
             | <FromValue> ":" [<ToValue>]
             | [<FromValue>] ":" <ToValue>
<FromValue>  ::= <Value>
<ToValue>    ::= <Value>
<Value>      ::= <NumericConstant>
             | <StringConstant>
             | <DateConstant>

Samples

1:20 30: means the valid values are between 1 and 20 and greater than or equal to 30.
1 2 3 4: means the valid value can be either 1, 2, 3 or 4.
'Y' 'N': means the valid value can be either 'Y' or 'N'.
#1753-01-01#:#2010-03-07#: means a date range.

Compatibility

Since GeneXus 17 Upgrade 4, this property also applies to SDT members.

See Also

Regular Expression property
Validation Failed Message property
Attribute definition

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