QR type

QR type documentation.

Overview

This type stores text and displays it as a QR code in read-only view.

Available features

NameSupported
Many multiplicityyes
Default valuesyes
Unique flagyes
Required flagyes
Indexable flagyes
Sensitive flagyes
Calculated valueyes
Automatic initializationno
Calculated initial valueno
Aggregationno
Default type rulesyes
Default display optionsyes

Type rules

Minimum length

The minimum number of characters that values can have.

Maximum length

The maximum number of characters that values can have.

Exact length

The value must have exactly this number of characters.

Regular expression

If set, you can provide a regular expression to validate the value of the field. The expression should follow Java regular expression syntax.

You will see the following options:

  • Expression: This is the regular expression used to validate values.
  • Hint: In case of a validation error, you can provide a message to be displayed to the user to assist them.
  • Case Insensitive: If enabled, matching will be case insensitive. Note that this applies only to simple characters in the expression. For example, [a-z] will require the letter to be in lowercase, even with this flag enabled. However, expressions like “ab” will work with variations in case when this flag is set.

Display options

Representation

Determines how the field should be displayed in the edit view. This only affects the edit view. Options include:

  • Input Box: Displays a single-line input box.
  • Text Area: Displays a text area. You can specify the number of rows for the text area.

Limit number of characters

Limits the number of characters displayed, with a "More" button to expand the content. This option is effective only in read-only mode.

Error correction level

QR codes have four error correction levels that add varying amounts of "backup" data, based on expected damage:

  • Level L – Up to 7% damage
  • Level M – Up to 15% damage
  • Level Q – Up to 25% damage
  • Level H – Up to 30% damage

Color

Hex color code for the QR code. Default is #000000.

Background color

Hex background color code for the QR code. Default is #ffffff.

Width

Width of the generated image in pixels. Default is 128.

Height

Height of the generated image in pixels. Default is 250

REST API

Read format

The format is a simple string:

"name": "test1"

Write format

To set the value, you should provide a string:

"name": "new name"

JavaScript API

Read format

The val() method within the wrapper will return a plain string:

// this will print something like "name: test1"
log('name: '+record.field('name').val());

Write format

You should provide a string to set the new value:

record.field('name').val('new name');

Export/Import

Export format

The export format is a simple string:

"textField1","textField2"
"value1","this is a long text"

Import format

The import format is a simple string:

"textField1","textField2"
"value1","this is a long text"

Queries

For more information, please refer to the Query Language Documentation.

Available operators

OperatorSupported
equalsyes
notEqualsyes
emptyyes
notEmptyyes
likeyes
greateryes
greaterOrEqualsyes
lessyes
lessOrEqualsyes
betweenyes
currentUserFieldno

Query formats

To perform queries, you should provide the text as a plain string. For example:

// finds companies with name like 'ae' 
var records_sample = sys.data.find('companies', {'name': 'like(ae)'});
log('total: '+records_sample.count());
while (records_sample.hasNext()) {
    log(records_sample.next().label());
}
// finds companies with name like 'ae' 
var query_sample = sys.data.createQuery('companies')
    .field('name').like('ae')
var records_sample = sys.data.find(query_sample);
log('total: '+records_sample.count());
while (records_sample.hasNext()) {
    log(records_sample.next().label());
}
// finds companies with name like 'ae' 
GET /data/contacts?name=like(ae)

Aggregate queries

Please refer to the Aggregate Queries Documentation for more detailed information.

Available operators

OperatorSupported
sumno
avgno
firstyes
lastyes
minyes
maxyes

UI queries

Please refer to the UI Queries Documentation for more detailed information.

Matching of values

PropertyDescription
Matching operatorlike

Available operators

OperatorSupported
Many valuesyes
Greaterno
Greater or equalsno
Lessyes
Less or equalsyes
Betweenno