# al-object-id-allocator > Allocate the next available Business Central AL object ID/number by scanning .al files and idRanges in app.json using the bundled PowerShell script. Use when creating new tables/pages/codeunits/extensions and you need a free object number. - Author: Flemming Bakkensen - Repository: FBakkensen/bc-agentic-dev-tools - Version: 20260105204401 - Stars: 0 - Forks: 0 - Last Updated: 2026-02-07 - Source: https://github.com/FBakkensen/bc-agentic-dev-tools - Web: https://mule.run/skillshub/@@FBakkensen/bc-agentic-dev-tools~al-object-id-allocator:20260105204401 --- --- name: al-object-id-allocator description: Allocate the next available Business Central AL object ID/number by scanning .al files and idRanges in app.json using the bundled PowerShell script. Use when creating new tables/pages/codeunits/extensions and you need a free object number. --- # AL Object ID Allocator Allocate the next available AL object number using `scripts/Get-NextALObjectNumber.ps1`. ## Usage ```powershell pwsh -File "\scripts\Get-NextALObjectNumber.ps1" -AppPath "" -ObjectType "" ``` Common patterns: - `pwsh -File ".\.claude\skills\al-object-id-allocator\scripts\Get-NextALObjectNumber.ps1" -AppPath ".\app" -ObjectType "table"` - `pwsh -File ".\.claude\skills\al-object-id-allocator\scripts\Get-NextALObjectNumber.ps1" -AppPath ".\test" -ObjectType "codeunit"` ## Supported object types table, page, codeunit, report, query, xmlport, enum, interface, controladdin, pageextension, tableextension, enumextension, reportextension, permissionset, entitlement, profile, pagecustomization ## Output and errors - On success, the script writes a single integer (the allocated number) to stdout and exits with code `0`. - On error, it writes `ERROR-XXX: ` to stderr and exits with code `1`. Tip: Capture the result in PowerShell: - `$nextNumber = & "\scripts\Get-NextALObjectNumber.ps1" -AppPath "" -ObjectType "page"` ## What it does (high level) 1. Reads `idRanges` from `\app.json` 2. Scans `\**\*.al` for existing objects of the requested type 3. Ignores commented-out declarations 4. Returns the smallest available number within the allowed ranges (fills gaps first)