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

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

u/Albertooz — 15 days ago
▲ 511 r/cleanjokes+1 crossposts

She got a job at the zoo after 5 years of unemployment. It did not go how she expected 🦁

Five years out of uni with a degree in Comparative Literature, and the only offer she ever got came from a zoo. 💀

Their lioness had died. The director didn't have the budget for a new one, but he did have the skin.

"You sit. You look majestic. Nobody asks questions."

She took it. Pay was terrible, but so was everything else.

Two weeks in, a keeper left the connecting gate open and the male lion walked in.

She froze. One thought, very clear: well, at least the student loan dies with me. 😭

The lion put his mouth to her ear.

"Relax," he whispered. "Kevin. Master's in Nuclear Economics." 🎓

Pause.

"The monkey's got a PhD. Don't get him started." 🐒

reddit.com
u/Albertooz — 1 month ago

The Burglar in the Closet

A foolish guy opens his closet at night, sees his own reflection in the mirror, and calls the police reporting a thief hiding inside. A policeman arrives, opens the closet, sees his own reflection, slaps the foolish guy, and says, "If you already have a police officer on the scene, why did you call me?!"

reddit.com
u/Albertooz — 1 month ago

Part 5 of my AL development series: table extensions, page extensions, and events

u/Albertooz — 3 months ago

Local AL Development Series: From Docker Setup to Your First Working Extension (4 parts)

I've been putting together a series on doing AL development locally for Business Central, from an empty machine all the way to a working extension you can click around in. Part 4 just went up, so all four are done now.

Part 1, getting a BC sandbox container running with Docker and BcContainerHelper:

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

Part 2, VS Code and your first AL project:

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

Part 3, launch.json, symbols, and publishing that first extension:

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

Part 4, building actual objects: a table, list and card pages, and a codeunit behind an action button:

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

Code for Part 4 is here if you want to poke at it: https://github.com/AlbertAssaad/TaskProject

It's written for people just getting into local AL dev. If you spot anything off or have suggestions, I'm listening.

reddit.com
u/Albertooz — 3 months ago
▲ 0 r/csharp+1 crossposts

I built an invoice pipeline in C# that turns an Excel sheet into PDF invoices with "Pay Now" QR codes (.NET 8)

Spent a weekend turning the usual month-end invoice grind into one small .NET 8 console app. It reads an order spreadsheet, renders a styled HTML invoice to PDF for each row, drops a scannable "Pay Now" QR on each one, then zips the whole month into a single archive.

Four stages, one library each from the Iron Suite: IronXL reads the Excel, IronPDF does the HTML-to-PDF through Chromium, IronQR makes the codes, IronZIP packs it up. The part I'm happiest with is that the stages don't know about each other, so if you want to read from a database instead of a spreadsheet, you only touch stage one.

Writeup: https://albertassaad.medium.com/building-an-invoice-automation-pipeline-in-c-with-the-iron-suite-0572d62e4925
Code: https://github.com/AlbertAssaad/Invoice-Automation

reddit.com
u/Albertooz — 4 months ago
▲ 5 r/Dynamics365+1 crossposts

Hi all,

I kept redoing the same Business Central local setup every time I switched machines, so I finally wrote the whole process down in one article.

It covers:

Prerequisites (Windows edition, RAM, disk, PowerShell)

Docker Desktop install and switching to Windows containers

Enabling Hyper-V and the Containers Windows features

Installing BcContainerHelper

The full New-BcContainer command, with each parameter explained (containerName, auth, artifactUrl, isolation, memoryLimit, useSSL, updateHosts, etc.)

A workaround for slow or limited internet — pulling the W1 and platform artifact URLs from PowerShell, downloading the zips with a download manager, and dropping them into C:\\bcartifacts.cache\\sandbox\\<version>\\w1\\ and \\platform\\ so BcContainerHelper skips the download

Accessing BC in the browser and the container commands I use the most

Next article in the series will cover VS Code, the AL Language extension, and publishing an extension to the container.

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

Happy to hear corrections or any tips you use in your own setup.

u/Albertooz — 5 months ago

This article walks through installing Visual Studio Code, pulling the AL Language VSIX directly from your bcserver container, and scaffolding your first AL project. The key takeaway is why you should grab the VSIX from your container instead of the Marketplace it ensures your AL compiler matches your BC platform version.

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

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

reddit.com
u/Albertooz — 6 months ago

Hi all,

I kept redoing the same Business Central local setup every time I switched machines, so I finally wrote the whole process down in one article.

It covers:

Prerequisites (Windows edition, RAM, disk, PowerShell)

Docker Desktop install and switching to Windows containers

Enabling Hyper-V and the Containers Windows features

Installing BcContainerHelper

The full New-BcContainer command, with each parameter explained (containerName, auth, artifactUrl, isolation, memoryLimit, useSSL, updateHosts, etc.)

A workaround for slow or limited internet — pulling the W1 and platform artifact URLs from PowerShell, downloading the zips with a download manager, and dropping them into C:\bcartifacts.cache\sandbox\<version>\w1\ and \platform\ so BcContainerHelper skips the download

Accessing BC in the browser and the container commands I use the most

Next article in the series will cover VS Code, the AL Language extension, and publishing an extension to the container.

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

Happy to hear corrections or any tips you use in your own setup.

medium.com
u/Albertooz — 6 months ago