Autocomplete attributes¶
Autocompletion type - " autoassigned ": true
- indicates that the value of this attribute should be filled automatically when creating a class. It is used mainly for attributes of the “Unique values” type ("unique": true
) for integers and string attributes, as well as for attributes of the “Date-time” type.
Principle of formation:¶
For the attributes of the “Date-time” type, an attribute should have the value of the current time. It is used in the time tag of created objects and committed changes.
For integer attributes, if the value “Unique identifier” (
"unique": true
) is specified when creating the form, it is filled in with a random set of characters.For strings, if the value “Unique identifier” (
"unique": true
) is specified, a random hex value should be generated - the size of the string length - 20 characters in the example below.var crypto = require('crypto'); ID = crypto.randomBytes(20).toString('hex');
For the “global identifier” type, the configuration is the same as for the string.
NB: You need to make a check when saving. The field should be generated automatically for empty values or dates. For all others (integer, string), previously created values must be generated.
Example:¶
{
"orderNumber": 50,
"name": "auto",
"caption": "auto",
"type": 6,
"size": null,
"decimals": 0,
"nullable": true,
"readonly": false,
"indexed": false,
"unique": true,
"autoassigned": true
}