Open
Description
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
parameter
New-BcContainer -accept_eula -artifactUrl (Get-BCArtifactUrl -type OnPrem -country w1 -version 24.3) -memoryLimit 16G -includeAL -containerName KZW1 -auth Windows -includeTestToolkit -includeTestLibrariesOnly -shortcuts None `
-featureKeys @{"ExtensibleExchangeRateAdjustment" = "All Users"; "ExtensibleInvoicePostingEngine" = "All Users"}
Option two. Using Set-BcContainerFeatureKeys
cmdlet
New-BcContainer -accept_eula -artifactUrl (Get-BCArtifactUrl -type OnPrem -country w1 -version 24.3) -memoryLimit 16G -includeAL -containerName KZW1 -auth Windows -includeTestToolkit -includeTestLibrariesOnly -shortcuts None
Set-BcContainerFeatureKeys -containerName KZW1 -featureKeys @{"ExtensibleInvoicePostingEngine"="1"}
Full output of scripts
Setting feature keys on database: CRONUS
Setting feature key ExtensibleInvoicePostingEngine to 1 - Failure
WARNING: Unable to set feature key ExtensibleInvoicePostingEngine
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
Activity
freddydk commentedon Aug 30, 2024
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?
MaxFalcone commentedon Aug 30, 2024
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.
MaxFalcone commentedon Aug 30, 2024
In case someone is looking for workaround. For now I'm just enabling required features through the installer codeunit of my test app.
KM-JAD commentedon Oct 2, 2024
Hi, missing record creation is solved (#3658).
The problem is that content of "virtual" table behind page "Feature Management" is updated dynamically from two tables during page opening:
So, each feature (and related AL code) is activated in particular company just solely in case that both records are set properly.
(second table will be updated after #3696 is confirmed)
freddydk commentedon Oct 10, 2024
@KM-JAD added a few comments to your PR - will review again once fixed