- All 7 existing Tier 1/2 knowledge files now include a BCApps Reference section with concrete source links and observed patterns - New: bcpt-scenarios-must-be-app-specific — PerformanceTest apps must include app-domain BCPT scenarios, not only Microsoft generic samples - New: permission-sets-must-follow-least-privilege — View/Edit/Admin hierarchy with IncludedPermissionSets, mirroring BCApps BusFound pattern - api-page-key-fields-must-be-editable-on-insert clarified: SystemId as ODataKeyField + Editable=false is valid (auto-generated); rule applies to consumer-provided key fields only Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2.3 KiB
AL Language Namespace Verification Rule
Core Requirement
When adding variables or references to Business Central objects, agents must verify namespaces by reading the actual source file—not by inference or training data assumptions.
Key Principle
The documentation emphasizes: "The authoritative source for a namespace is always the object's own source file." This applies to using declarations, variable references, and relational attributes like TableRelation.
Verification Process
The prescribed workflow involves three steps:
- Locate the object's source file using glob patterns or symbol search
- Read the namespace declaration from line one
- Add the verified namespace to the consuming file's
usingstatements
Critical Distinction
A file may compile in an agent's local build but display errors in VS Code because the AL Language Server uses different namespace resolution. "The definitive compilation result is what VS Code shows—not the agent's internal build."
What to Avoid
The anti-pattern warns against incomplete namespaces like using SettlementVoucher; and guessed namespaces such as using Microsoft.Purchases.Vendor; without verification.
Pre-Delivery Checklist
Before delivering code, agents must:
- Enumerate all
usingstatements - Confirm each namespace derives from actual source inspection or symbol lookup
- Correct any assumed namespaces by re-reading the source
This rule reflects that Microsoft's namespace structure changed significantly from BC24 onward, making assumptions increasingly unreliable.
BCApps Reference
BCApps is the authoritative source for all Microsoft namespace paths post-BC24. The entire Microsoft.* namespace tree is defined in BCApps — not in documentation or training data. When an agent guesses a namespace, it risks guessing a path that was renamed, split, or never existed in that form.
- Source: https://github.com/microsoft/BCApps/tree/main/src
- Example:
BCPTSuiteAPI.Page.aldeclaresnamespace System.Tooling;— guessingSystem.PerformanceorMicrosoft.BC.Toolswould compile locally but break in VS Code's language server. - Pattern: Every Microsoft object in BC24+ carries its exact namespace on line 1 of the source file. Reading that line is the only reliable verification method.