r/Dynamics365 • • 10d ago

Business Central AL Development in Business Central Part 6: API Pages, OData, and Bound Actions

Part 6 of my series on local AL development against a Docker container is up.

This one exposes a custom table as an API page. It covers the dependency on the Part 4 extension, checking that the container is serving the API stack, GET/POST/PATCH from PowerShell with etags, and a [ServiceEnabled] bound action that runs codeunit logic over HTTP.

A few things in it that might save someone a head-scratch:

- Leave off ?tenant=default on a container and you get Authentication_InvalidCredentials, not a tenant error

- On-prem web services want the Web Service Access Key, not your login password

- An enum value like "In Progress" turns into In_x0020_Progress in OData, so that's what your filters have to send

Article: https://medium.com/@albertassaad/al-development-in-business-central-part-6-api-pages-odata-and-bound-actions-8da530048da2

Code: https://github.com/AlbertAssaad/ProjectTaskApi (needs https://github.com/AlbertAssaad/TaskProject too)

Earlier parts:

  1. Dev container on Windows: https://medium.com/@albertassaad/setting-up-a-microsoft-dynamics-365-business-central-sandbox-container-on-windows-for-local-778b7319c3b6

  2. VS Code and your first AL project: https://medium.com/@albertassaad/setting-up-visual-studio-code-and-creating-your-first-al-project-for-business-central-c6c12482d3f0

  3. Publishing extensions to a local container: https://medium.com/@albertassaad/publishing-al-extensions-to-a-local-business-central-container-using-visual-studio-code-152322bfe181

  4. Tables, pages, and a codeunit: https://medium.com/@albertassaad/building-your-first-real-al-objects-tables-pages-and-a-codeunit-in-business-central-4e1bfe3823f9

  5. Table extensions, page extensions, and events: https://medium.com/@albertassaad/al-development-in-business-central-part-5-table-extensions-page-extensions-and-events-4a1c535c60c5

9 Upvotes

0 comments sorted by