Setting up an auto increment field in Master Data v2
Auto increment is a Master Data feature that automatically creates unique and sequential values to integer type fields when new documents are created.
The starting value of auto increment fields is always
1. This value can not be changed.
Set up
Auto increment fields can be set up in data entities' JSON schemas.
Create an integer field and add its name to the v-auto-increment property, like in the example below:
_10{_10 "properties": {_10 "valueAsAutoIncrement": {_10 "type": "integer"_10 }_10 },_10 "v-auto-increment": [_10 "valueAsAutoIncrement"_10 ]_10}
- The auto-increment field cannot be
required.
- The field's type has to be
integer.
Usage
When saving new documents you must identify the corresponding JSON Schema with the query parameter _schema. See an example of this:
_10POST_10https://{accountName}.{environment}.com.br/api/dataentities/{dataEntityName}/documents?_schema={schemaName}