Back to Skills

al-object-id-allocator

verified

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.

View on GitHub

Marketplace

bc-agentic-dev-tools

FBakkensen/bc-agentic-dev-tools

Plugin

al-object-id-allocator

Repository

FBakkensen/bc-agentic-dev-tools

plugins/al-object-id-allocator/skills/al-object-id-allocator/SKILL.md

Last Verified

January 20, 2026

Install Skill

Select agents to install to:

Scope:
npx add-skill https://github.com/FBakkensen/bc-agentic-dev-tools/blob/main/plugins/al-object-id-allocator/skills/al-object-id-allocator/SKILL.md -a claude-code --skill al-object-id-allocator

Installation paths:

Claude
.claude/skills/al-object-id-allocator/
Powered by add-skill CLI

Instructions

# AL Object ID Allocator

Allocate the next available AL object number using `scripts/Get-NextALObjectNumber.ps1`.

## Usage

```powershell
pwsh -File "<skill-folder>\scripts\Get-NextALObjectNumber.ps1" -AppPath "<AL_APP_FOLDER>" -ObjectType "<type>"
```

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: <message>` to stderr and exits with code `1`.

Tip: Capture the result in PowerShell:
- `$nextNumber = & "<skill-folder>\scripts\Get-NextALObjectNumber.ps1" -AppPath "<AL_APP_FOLDER>" -ObjectType "page"`

## What it does (high level)

1. Reads `idRanges` from `<AppPath>\app.json`
2. Scans `<AppPath>\**\*.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)

Validation Details

Front Matter
Required Fields
Valid Name Format
Valid Description
Has Sections
Allowed Tools
Instruction Length:
1388 chars