Unbound actions in AL (via OData V4) provide a flexible way to expose logic not tied to specific entities. However, in the current Business Central development model, they are not treated as first-class citizens:
- No dedicated codeunit type to distinguish them from standard business logic.
- Manual registration is required via the Web Services page.
- No metadata, versioning, or built-in routing structure like API Pages offer.
- No way to clearly define and govern reusable service endpoints.
This makes the experience inconsistent and more difficult for developers building modern integrations or replacing SOAP-based services.
More: https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/devenv-creating-and-interacting-with-odatav4-unbound-action
We propose introducing a dedicated API codeunit subtype in AL to give unbound actions first-class citizen status in Business Central development.
codeunit 50110 "CustomerApiOperations"
{
Subtype = API;
APIPublisher = 'mycompany';
APIGroup = 'customerOps';
APIVersion = 'v2.0';
procedure Ping(input: Integer): Integer
begin
exit(-input);
end;
procedure NotifyCustomer(inputJson: Text): Boolean
var
payload: JsonObject;
customerNo: Code[20];
begin
payload.ReadFrom(inputJson);
if payload.Get('customerNo', customerNo) then
Message('Customer %1 has been notified.', customerNo);
exit(true);
end;
}
Automatically exposed as:
POST /api/mycompany/customerOps/v2.0/Ping
POST /api/mycompany/customerOps/v2.0/NotifyCustomer
Making unbound actions first-class citizens in AL would:
- Encourage modern, function-based integration patterns (microservices, headless scenarios, automation).
- Simplify discovery, documentation (OpenAPI), and versioning.
- Align AL development more closely with modern API-first standards.
- Make AL more expressive and efficient for scenarios where no table binding is needed.
Comments
This could also allow you to process json payloads that don't fit within the structure of a page, so all for it!This seems to happen more and more often that we come across a json structure we cannot fit in the "rigid" structure of a page
Category: Development
Business Central Team (administrator)
Thank you for this suggestion! Currently this is not on our roadmap. We are tracking this idea and if it gathers more votes and comments we will consider it in the future. Best regards, Business Central Team