I do apologies in advanced if this has been answered, however I have not been able to find the thread related to my question.
I am creating a Base plus entity for stock control. I would like to use the default Name field as the Serial number. This obivously has to be unique to prevent duplicates on inventory control.
Now I have successfully used the "unique": true within the json file for a custom field, but if I add that on the default Name field it does not work.
Below is the copy of InventoryControl.json in Custom..//metadata/entityDefs
serialNumControl is the one I have applied unique: true and it is working. However with name it does not apply.
I am creating a Base plus entity for stock control. I would like to use the default Name field as the Serial number. This obivously has to be unique to prevent duplicates on inventory control.
Now I have successfully used the "unique": true within the json file for a custom field, but if I add that on the default Name field it does not work.
Below is the copy of InventoryControl.json in Custom..//metadata/entityDefs
{
"fields": {
"name": {
"type": "varchar",
"required": true,
"trim": true,
"unique": true,
"pattern": "$noBadCharacters",
"options": []
},
"description": {
"type": "text"
},
"createdAt": {
"type": "datetime",
"readOnly": true
},
"modifiedAt": {
"type": "datetime",
"readOnly": true
},
"createdBy": {
"type": "link",
"readOnly": true,
"view": "views/fields/user"
},
"modifiedBy": {
"type": "link",
"readOnly": true,
"view": "views/fields/user"
},
"assignedUser": {
"type": "link",
"required": true,
"view": "views/fields/assigned-user"
},
"teams": {
"type": "linkMultiple",
"view": "views/fields/teams"
},
"serialNumControl": {
"type": "varchar",
"required": true,
"maxLength": 150,
"unique": true,
"options": [],
"isCustom": true
}
},
"fields": {
"name": {
"type": "varchar",
"required": true,
"trim": true,
"unique": true,
"pattern": "$noBadCharacters",
"options": []
},
"description": {
"type": "text"
},
"createdAt": {
"type": "datetime",
"readOnly": true
},
"modifiedAt": {
"type": "datetime",
"readOnly": true
},
"createdBy": {
"type": "link",
"readOnly": true,
"view": "views/fields/user"
},
"modifiedBy": {
"type": "link",
"readOnly": true,
"view": "views/fields/user"
},
"assignedUser": {
"type": "link",
"required": true,
"view": "views/fields/assigned-user"
},
"teams": {
"type": "linkMultiple",
"view": "views/fields/teams"
},
"serialNumControl": {
"type": "varchar",
"required": true,
"maxLength": 150,
"unique": true,
"options": [],
"isCustom": true
}
},
Comment