The procedure GetApplicationAreas in codeunit 9177 "Application Area Cache" does only remove spaces from the fieldref name.
We have used a dash "-" in our combined prefix, which leads to errors when the plattform procedure ApplicationArea is called.
Maybe all other special characters should be removed too.
And you should maybe improve the documentaiton, too.
https://docs.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/devenv-extending-application-areas#adding-an-application-area
[Scope('OnPrem')]
procedure SetupApplicationArea()
begin
ApplicationArea(GetApplicationAreas());
end;
local procedure GetApplicationAreas(ApplicationAreaSetup: Record "Application Area Setup") ApplicationAreas: Text
var
RecRef: RecordRef;
FieldRef: FieldRef;
FieldIndex: Integer;
begin
RecRef.GetTable(ApplicationAreaSetup);
// Index 1 to 3 are used for the Primary Key fields, we need to skip these fields
for FieldIndex := 4 to RecRef.FieldCount do begin
FieldRef := RecRef.FieldIndex(FieldIndex);
if FieldRef.Value() then
if ApplicationAreas = '' then
ApplicationAreas := '#' + DelChr(FieldRef.Name)
else
ApplicationAreas := ApplicationAreas + ',#' + DelChr(FieldRef.Name);
end;
end;
This results in a runtime bug that prevents the Client from loading.
Comments
Related GitHub Issue: https://github.com/microsoft/ALAppExtensions/issues/19758
Category: General
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