Overview
A mask can be specified so the text stored in this field follows a specific pattern.
Only the text entered by the user will be stored, which means that if there are characters coming from the mask
those won’t be saved. For example if the mask is 999-aaa
and the value is 123-ABC
, value stored
in the database will be 123ABC
.
Available features
Name | Supported | Notes |
---|---|---|
Many multiplicity |
yes |
|
Default values |
yes |
|
Unique flag |
yes |
|
Required flag |
yes |
|
Indexable flag |
yes |
|
Sensitive flag |
yes |
|
Calculated value |
yes |
|
Automatic initialization |
no |
|
Calculated initial value |
no |
|
Aggregation |
no |
|
Default type rules |
yes |
|
Default display options |
no |
|
Type rules
Mask
This is the mask that will be used to validate values. Special characters in the mask are:
9
: must be a number.a
: must be a letter.w
: must be a number or a letter.
You could also put other characters that will be fixed in the mask. For example the mask 999-aaa
will accept the following values: 123-ABC
, 123ABC
. As you can see you can skip the dash because
that’s part of the mask.
In the UI special characters like 9
, a
and w
will be displayed as empty spaces where you can
type something. Other characters will be displayed as they are and will be read-only.
Display options
REST API
Read format
The format is a simple string, which will be already formatted with the mask:
"taxId": "862-SKB"
Write format
You should pass a string with the value:
"taxId": "123-ABC"
You can skip fixed characters in the mask:
"taxId": "123ABC"
Javascript API
Read format
The val()
method in the wrapper will return an already formatted string:
// this will print something like "taxId: 123-ABC"
log('taxId: '+record.field('taxId').val());
Write format
You can pass the value with the mask format or without it:
// all these lines are equivalent
record.field('taxId').val('123-ABC');
record.field('taxId').val('123ABC');
Wrapper
Export/Import
Export format
The export format is a simple string:
"maskedTextField1","maskedTextField2"
"abc-123","udl-860"
Import format
The import format is a simple string:
"maskedTextField1","maskedTextField2"
"abc-123","udl-860"
Queries
Please check the documentation for Query language for more information.
Available operators
Operator | Supported | Notes |
---|---|---|
equals |
yes |
|
notEquals |
yes |
|
empty |
yes |
|
notEmpty |
yes |
|
like |
yes |
It is important to note that in this case the matching will be done with the value stored in the database,
which means that fixed characters in the mask won’t be taken into account. For example if the mask is |
greater |
yes |
|
greaterOrEquals |
yes |
|
less |
yes |
|
lessOrEquals |
yes |
|
between |
yes |
|
currentUserField |
no |
|
Query formats
For equality queries you can pass the value with the mask format or without it. For example:
// finds companies with tax ID '123-ABC'
var records = sys.data.find('companies', {'taxId': '123-ABC'});
log('total: '+records.count());
while (records.hasNext()) {
log(records.next().label());
}
// finds companies with tax ID '123-ABC'
var query = sys.data.createQuery('companies')
.field('taxId').equals('123-ABC');
var records = sys.data.find(query);
log('total: '+records.count());
while (records.hasNext()) {
log(records.next().label());
}
finds companies with tax ID '123-ABC'
GET /data/companies?name=123-ABC
You could skip the fixed characters in the mask as well:
// finds companies with tax ID '123-ABC'
var records = sys.data.find('companies', {'taxId': '123ABC'});
log('total: '+records.count());
while (records.hasNext()) {
log(records.next().label());
}
// finds companies with tax ID '123-ABC'
var query = sys.data.createQuery('companies')
.field('taxId').equals('123ABC');
var records = sys.data.find(query);
log('total: '+records.count());
while (records.hasNext()) {
log(records.next().label());
}
finds companies with tax ID '123-ABC'
GET /data/companies?name=123ABC
Keep in mind that you cannot use the formatted form when using the like
operator as the match
will be done with the value stored in the database.
Aggregate queries
Please check the documentation for Aggregate queries for more information.
Available operators
Operator | Supported | Notes |
---|---|---|
sum |
no |
|
avg |
no |
|
first |
yes |
|
last |
yes |
|
min |
yes |
|
max |
yes |
|
UI queries
Please check the documentation for UI queries for more information.
Matching of values
Property | Description |
---|---|
Matching operator |
Keep in mind that you cannot use the formatted value. See the notes in the |
Special values |
Available operators
Operator | Supported | Notes |
---|---|---|
Many values |
yes |
|
Greater |
no |
|
Greater or equals |
no |
|
Less |
yes |
|
Less or equals |
yes |
|
Between |
no |
|