We’d like to change the Application Areas in our next version by using the ApplicationAreaMgmtFacade.RefreshExperienceTierCurrentCompany(); in an upgrade codeunit. Currently when we use this function in an upgrade code it sets the application area back to standard and does not use the code we have implemented in the eventsubscriber. Simple sample code below. Calling the same code triggered by an event in the UI/Product works fine. Seems like to me we can’t use this function in an upgrade codeunit. Currently using BC18.1 saas, and testing by publishing (increase version no.) a dev extension to a sandbox environment.
trigger OnUpgradePerCompany();
begin
AddAzureAppAreaValues();
end;
local procedure AddAzureAppAreaValues()
var
ApplicationAreaMgmtFacade: Codeunit "Application Area Mgmt. Facade";
begin
ApplicationAreaMgmtFacade.RefreshExperienceTierCurrentCompany();
end;
[EventSubscriber(ObjectType::Codeunit, Codeunit::"Application Area Mgmt. Facade", 'OnGetBasicExperienceAppAreas', '', true, true)]
local procedure AddAdditionalApplicationToBasic(var TempApplicationAreaSetup: Record "Application Area Setup" temporary)
begin
TempApplicationAreaSetup."Customer Area" := true;
TempApplicationAreaSetup.Comments := true;
end;