Build a custom AL API page in Dynamics 365 Business Central to expose production order header and line data over OData v4 for an external MES integration

domain: learn.microsoft.com · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Create an AL extension; define a page of type API with properties APIPublisher, APIGroup (e.g., 'manufacturing'), APIVersion ('v1.0'), EntityName, and EntitySetName pointing to the Production Order table (Table 5405).
  2. Add fields from the Production Order table (No., Description, Status, Source No., Quantity, Due Date) as part properties in the page.
  3. Define a subpage of type API for production order lines (Table 5406 – Prod. Order Line) and link it via a part with SubPageLink = "Status" = FIELD(Status), "Prod. Order No." = FIELD(No.).
  4. Publish the extension to a sandbox environment; the endpoint will be available at /api/<publisher>/<group>/v1.0/companies(<id>)/productionOrders.
  5. Secure the endpoint by assigning the API permission set to the integration user; test with a GET request including $expand=productionOrderLines.
  6. To allow status changes from the MES, add an OData action (bound function or unbound action via a Codeunit API) to transition the production order status — direct field writes on Status are blocked by business logic.

Known gotchas

Related routes

Register a Dynamics 365 Dataverse custom API (not a plugin step) to expose a reusable business operation as a bound or unbound OData action callable from Power Automate and external clients
dynamics.microsoft.com · 5 steps · unrated
Query and update BOM line data entities in Dynamics 365 Finance and Operations using the OData API (BOMLineEntity / BOMHeaderV2Entity)
learn.microsoft.com · 6 steps · unrated
Call an OData bound action on a Business Central API page record
business-central · 5 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans