-
Notifications
You must be signed in to change notification settings - Fork 247
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Set-BcContainerFeatureKeys is not working #3609
Comments
So, you are saying that if you run the Set-BcContainerFeatureKeys after you went into the UI - then the key is there and it works? |
No. Set-BcContainerFeatureKeys won't work at all. It tries to update record in the table, but record is not present there initially. It will be created only when you toggle feature through UI. |
In case someone is looking for workaround. For now I'm just enabling required features through the installer codeunit of my test app. codeunit 50000 Installer
{
Subtype = Install;
trigger OnInstallAppPerDatabase();
begin
EnableFeatureKeys();
end;
local procedure EnableFeatureKeys()
var
ExtensibleExchangeRateAdjustmentLbl: Label 'ExtensibleExchangeRateAdjustment', Locked = true;
ExtensibleInvoicePostingEngineLbl: Label 'ExtensibleInvoicePostingEngine', Locked = true;
begin
EnableFeatureKey(ExtensibleExchangeRateAdjustmentLbl);
EnableFeatureKey(ExtensibleInvoicePostingEngineLbl);
end;
local procedure EnableFeatureKey(FeatureKeyName: Text)
var
FeatureKey: Record "Feature Key";
FeatureManagementFacade: Codeunit "Feature Management Facade";
begin
if FeatureKey.Get(FeatureKeyName) then
if FeatureKey.Enabled = FeatureKey.Enabled::None then begin
FeatureKey.Enabled := FeatureKey.Enabled::"All Users";
FeatureKey.Modify();
FeatureManagementFacade.AfterValidateEnabled(FeatureKey);
end;
end;
} |
Hi, missing record creation is solved (#3658).
(second table will be updated after #3696 is confirmed) |
@KM-JAD added a few comments to your PR - will review again once fixed |
Describe the issue
Set-BcContainerFeatureKeys is not enabling feature keys because it tries to update record in
Tenant Feature Key
table but record is missing initially and only created when you enable feature manually via UI.Scripts used to create container and cause the issue
Option one. Using
featureKeys
parameterOption two. Using
Set-BcContainerFeatureKeys
cmdletFull output of scripts
Screenshots
Here is the
Feature Management
list. Feature (1) I've just enabled, feature (2) is not enabled but present in the list.Here is the content of
Tenant Feature Key
table in the database. Feature (1) is present and enabled. Feature (2) is not present.Additional context
BCContainerHelper version 6.0.19
The text was updated successfully, but these errors were encountered: