bcquality/custom/knowledge/api/expose-bc-entities-as-api-pages-for-external-agents.good.al
Tharanga Chandrasekara 07140e2223 Add new action skills for AL testing and documentation
- Introduced `al-test-writer` to generate AL test codeunits for production objects based on TDD principles.
- Added `al-userguide-test-writer` to create test codeunits from user guide steps, mapping actions and assertions.
- Implemented `bc-extension-test-guide` to generate a comprehensive TEST_GUIDE.md for Business Central extensions, covering various categories.
- Created `bc-webclient-runner` to automate UI testing of the Business Central web client, capturing screenshots and asserting UI states.
- Developed `page-scripting-e2e` to produce a recording plan for Page Scripting, ensuring a structured approach to browser-level testing.
2026-06-07 12:26:47 +12:00

44 lines
1.7 KiB
AL

// Best practice: a top-level API page whose entity names and version form a
// stable contract for an external agent, shaped read-only because the agent's
// workflow only needs to read. Demonstration-only; not a deployed object.
page 50120 "Agent Customer API"
{
// Only top-level PageType = API pages surface as agent tools. A ListPart or
// CardPart here would be silently unreachable by the agent.
PageType = API;
SourceTable = Customer;
// These five properties are the contract. They are fixed literals, so the
// route and the tool names the agent binds to never shift under it.
APIPublisher = 'contoso';
APIGroup = 'sales';
APIVersion = 'v1.0';
// EntityName and EntitySetName become the singular/plural tool names. They
// use the agent's domain vocabulary, not the table's internal captions.
EntityName = 'customer';
EntitySetName = 'customers';
// The agent only reads, so the whole surface is locked to read. A read tool
// can never mutate, no matter what the prompt asks for.
Editable = false;
InsertAllowed = false;
ModifyAllowed = false;
DeleteAllowed = false;
layout
{
area(Content)
{
repeater(Group)
{
// A narrow, deliberately chosen field set: exactly what the
// agent reasons over, named for the agent, nothing more.
field(number; Rec."No.") { Caption = 'number'; }
field(displayName; Rec.Name) { Caption = 'displayName'; }
field(city; Rec.City) { Caption = 'city'; }
field(balanceDue; Rec."Balance Due (LCY)") { Caption = 'balanceDue'; }
}
}
}
}