{"title":"PerTenantExtensionCop Error PTE0001","url":"https://jonas-paprotka.de/docs/dev-itpro/developer/analyzers/pertenantextensioncop-pte0001/","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/analyzers/pertenantextensioncop-pte0001, 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/analyzers/pertenantextensioncop-pte0001","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":"Object ID must be in free range.","date":"2026-10-01","meta":{"topic":"reference"},"outline":[{"level":1,"title":"PerTenantExtensionCop Error PTE0001","slug":"pertenantextensioncop-error-pte0001","at":0,"chars":1061},{"level":2,"title":"Description","slug":"description","at":71,"chars":48},{"level":2,"title":"Remarks","slug":"remarks","at":119,"chars":243},{"level":2,"title":"How to fix this diagnostic?","slug":"how-to-fix-this-diagnostic","at":362,"chars":138},{"level":2,"title":"Code example triggering the rule","slug":"code-example-triggering-the-rule","at":500,"chars":195},{"level":2,"title":"Code examples not triggering the rule","slug":"code-examples-not-triggering-the-rule","at":695,"chars":201},{"level":2,"title":"Related information","slug":"related-information","at":896,"chars":165}],"text":"# PerTenantExtensionCop Error PTE0001\nObject ID must be in free range.\n## Description\nObject ID must be in free range.\n## Remarks\nThis rule validates that all the object IDs defined in your extension are within range 50,000-99,999 that is allocated for per-tenant extensions. For more information about the ID ranges for extensions, see ../devenv-object-ranges.\n## How to fix this diagnostic?\nYou must change the ID of the object or table field validated to use an ID within the range 50,000-99,999.\n## Code example triggering the rule\n```al\ncodeunit 10 MyCodeunit\n{\n    // Business logic\n}\n```\nThe codeunit MyCodeunit has the ID `10` which is not valid because it is outside the allowed range.\n## Code examples not triggering the rule\n```al\ncodeunit 50100 MyCodeunit\n{\n    // Business logic\n}\n```\nThe codeunit MyCodeunit has the 50100 `10` which is valid because it is within the allowed range.\n## Related information\nPerTenantExtensionCop Analyzer<pertenantextensioncop>\nGet Started with AL<../devenv-get-started>\nDeveloping Extensions<../devenv-dev-overview>"}