{"title":"AutoIncrement Property","url":"https://jonas-paprotka.de/docs/dev-itpro/developer/properties/devenv-autoincrement-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-autoincrement-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-autoincrement-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 whether the field value should be automatically incremented.","date":"2026-10-01","meta":{"topic":"reference"},"outline":[{"level":2,"title":"Applies to","slug":"applies-to","at":126,"chars":143},{"level":2,"title":"Property Value","slug":"property-value","at":269,"chars":297},{"level":2,"title":"Syntax","slug":"syntax","at":566,"chars":67},{"level":2,"title":"Remarks","slug":"remarks","at":633,"chars":1001},{"level":2,"title":"Related information","slug":"related-information","at":1634,"chars":40}],"text":"> Version: _Available or changed with runtime version 1.0._\nSets whether the field value should be automatically incremented.\n## Applies to\n Table field\nThe fields must be of Integer Data Type<../methods-auto/library> and BigInteger Data Type<../methods-auto/library>.\n## Property Value\nTrue if the field value is automatically incremented; otherwise, false. The default value is false.\n> NOTE\n> If you want to manually assign a value to a field that has the AutoIncrement property set to true, you must be member of the SQL Server db_owner database permission set.\n## Syntax\n```al\nfield(4; D; Integer) { AutoIncrement = true; }\n```\n## Remarks\nA table can only contain one auto-increment field. The numbers assigned to this field will not always be consecutive for the following reasons:\n If you delete some records from a table, the numbers used for these records are not reused.\n If several transactions are performed at the same time, they will each be assigned a different number. However, if one of these transactions is rolled back, the number that it was assigned is not reused.\nIf you add an auto-increment field to an existing table, the field automatically generates consecutive values and inserts them into the table. If you enable the AutoIncrement property for a field that already contains data, there must be no zero values in the field.\nThe AutoIncrement property is designed to always assign numbers automatically. If you want to insert a record, be sure that the value in this field is blank before you insert the record.\nThe AutoIncrement property does not work with Dynamics 365 Business Central temporary tables.\n## Related information\ndevenv-properties"}