{"title":"Unique Property","url":"https://jonas-paprotka.de/docs/dev-itpro/developer/properties/devenv-unique-property/","by":"JOP-AL","license":"Copyright (c) Microsoft Corporation. CC BY 4.0, https://creativecommons.org/licenses/by/4.0/; code samples MIT. From https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/properties/devenv-unique-property, MicrosoftDocs/dynamics365smb-devitpro-pb at 828b6ee (2026-11-19). Changed: includes filled in, links to this site, and for agents shortened without dropping a fact.","credit":"Microsoft Corporation, CC BY 4.0","origin":"https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/properties/devenv-unique-property","source":{"name":"Business Central developer and IT pro docs","repo":"https://github.com/MicrosoftDocs/dynamics365smb-devitpro-pb","commit":"828b6ee72fcd75755627cd6011f3d20899217ab2","date":"2026-11-19"},"checked":"2026-11-19","description":"Sets a value that indicates whether a SQL Server unique constraint that corresponds to the key should be created.","date":"2026-10-01","meta":{"topic":"reference"},"outline":[{"level":2,"title":"Applies to","slug":"applies-to","at":174,"chars":97},{"level":2,"title":"Property Value","slug":"property-value","at":271,"chars":96},{"level":2,"title":"Remarks","slug":"remarks","at":367,"chars":301},{"level":2,"title":"Example","slug":"example","at":668,"chars":275},{"level":2,"title":"Related information","slug":"related-information","at":943,"chars":43}],"text":"> Version: _Available or changed with runtime version 3.0._\nSets a value that indicates whether a SQL Server unique constraint that corresponds to the key should be created.\n## Applies to\n Table key\n> NOTE\n> The Unique property cannot be used in table extension objects.\n## Property Value\ntrue if the key value must be unique; otherwise, false. The default is false.\n## Remarks\nA unique index ensures that records in a table do not have identical field values. With a unique index, when a table is validated, values of the field that makes up the key are checked for uniqueness. If the table includes records with duplicate values for the field, the validation fails.\n## Example\nThe following example defines a primary key and two unique secondary keys.\n```al\nkeys\n{\n    key(PrimaryKey; ID)\n    {\n\n    }\n    key(CustomerInfo; Name,Address,City)\n    {\n        Unique = true;\n    }\n   key(Email; Email)\n    {\n        Unique = true;\n    }\n}\n\n```\n## Related information\n../devenv-table-keys"}