-
Notifications
You must be signed in to change notification settings - Fork 317
Description
Describe the issue
Due to the new pricing implementation in company information, the behaviour of feature activation changed significantly.
Before BC 28.x, it was possible to check the 'Feature Data Update Status' table to find out if the feature was activated. With the beginning of BC 28.x, however, the entry in the table is missing. After some research, we found that the new logic either inserts the entry into the table and activates the feature, or creates the entry when the feature management page is opened. This new logic for the activation by the company information field is located in the 'Feature Price Calculation' Codeunit, in the 'CopyBasicPricingData' function.
if not FeatureDataUpdateStatus.Get(PriceCalculationMgt.GetFeatureKey(), CompanyName()) then begin
FeatureDataUpdateStatus.Init();
FeatureDataUpdateStatus.'Feature Key' := PriceCalculationMgt.GetFeatureKey();
FeatureDataUpdateStatus.'Company Name' := CopyStr(CompanyName(), 1, MaxStrLen(FeatureDataUpdateStatus.'Company Name'));
FeatureDataUpdateStatus.'Data Update Required' := true;
FeatureDataUpdateStatus.'Use Default Price Lists' := true;
FeatureDataUpdateStatus.Insert(true);
end;
This really is an undesirable change in terms of test code. We will be forced to change all tests that activate the feature to make it work as before. This is a BREAKING CHANGE.
When the feature is activated the old way, the company information won't be updated and will still show 'Basic Pricing'.
This is also undesirable because the old (new) function 'IsExtendedPriceCalculationEnabled' now checks the company information for activation rather than the feature management.
We cannot find any notes or remarks regarding this significant behaviour change. There will also be some more questions regarding the prospect of changing the pricing implementation 'on the fly'.
Will the old pricing still be available in future, or would hundreds of days spent developing and moving to the new pricing implementation have been unnecessary?
Expected behavior
Feature activation behaviour like it was before
Steps to reproduce
local procedure ActivateBcExtPriceCalc()
var
featureKey: Record "Feature Key";
featureDataUpdateStatus: Record "Feature Data Update Status";
featureManagementFacade: Codeunit "Feature Management Facade";
priceCalc: Codeunit "Price Calculation Mgt.";
enabled: Boolean;
begin
if not priceCalc.IsExtendedPriceCalculationEnabled() then begin
if featureDataUpdateStatus.Get('SalesPrices', CompanyName()) then begin
featureDataUpdateStatus."Data Update Required" := true;
featureDataUpdateStatus."Use Default Price Lists" := true;
featureDataUpdateStatus.Confirmed := true;
Codeunit.Run(Codeunit::"Update Feature Data", featureDataUpdateStatus);
featureKey.Get('SalesPrices');
featureKey.Enabled := featureKey.Enabled::"All Users";
featureKey.Modify();
end;
end;
end;
Additional context
No response
I will provide a fix for a bug
- I will provide a fix for a bug