Describe the issue
In SubscriptionLine.Table.al, the local procedure SetUsageDataBillingFilters filters usage data billing records with a bounded enum range:
UsageDataBilling.SetRange("Usage Base Pricing", Enum::"Usage Based Pricing"::"Usage Quantity", Enum::"Usage Based Pricing"::"Unit Cost Surcharge");
This SetRange(field, from, to) relies on the ordinal boundaries of enum 8007 "Usage Based Pricing" (ordinals Usage Quantity = 1 through Unit Cost Surcharge = 3). If a partner extends enum 8007 with custom option values above Unit Cost Surcharge, those values fall outside the assumed upper bound and are silently excluded from the filter, which can leave the returned UsageDataBilling recordset empty. This is an extensibility/design limitation: partners who extend the pricing enum cannot obtain correct filtering behavior, and there is no hook to adjust the filters that SetUsageDataBillingFilters applies.
Two things are needed:
- Change the
SetRange("Usage Base Pricing", ...) call so it no longer assumes the enum ends at Unit Cost Surcharge. It should include the range Usage Quantity..Unit Cost Surcharge plus all values greater than Unit Cost Surcharge, so custom option values added above Unit Cost Surcharge are not excluded.
- Add an integration event at the end of
SetUsageDataBillingFilters so partners can further adjust or extend the filters applied to UsageDataBilling.
Proposed change
- Replace the ordinal-bounded
SetRange in SetUsageDataBillingFilters with filtering that covers Usage Quantity..Unit Cost Surcharge and everything above Unit Cost Surcharge (for example a SetFilter on the ordinal range plus > Unit Cost Surcharge, or otherwise avoiding the hard upper bound), so custom enum values are not dropped.
- Add a new
[IntegrationEvent(false, false)] publisher (e.g. OnAfterSetUsageDataBillingFilters) raised at the end of SetUsageDataBillingFilters, passing var UsageDataBilling, the source SubscriptionLine record, and the BillingFromDate / BillingToDate parameters, so subscribers can add or modify filters.
Expected behavior
A dependent extension that adds custom values to enum 8007 "Usage Based Pricing" (once the enum is extensible) gets those records included by the built-in filter instead of an empty recordset, and can subscribe to the new integration event to refine the filters applied to UsageDataBilling — without needing to override or replace the base filtering logic.
Steps to reproduce
not applicable
Additional context
No response
I will provide a fix for a bug
Describe the issue
In
SubscriptionLine.Table.al, the local procedureSetUsageDataBillingFiltersfilters usage data billing records with a bounded enum range:This
SetRange(field, from, to)relies on the ordinal boundaries of enum 8007 "Usage Based Pricing" (ordinalsUsage Quantity= 1 throughUnit Cost Surcharge= 3). If a partner extends enum 8007 with custom option values aboveUnit Cost Surcharge, those values fall outside the assumed upper bound and are silently excluded from the filter, which can leave the returnedUsageDataBillingrecordset empty. This is an extensibility/design limitation: partners who extend the pricing enum cannot obtain correct filtering behavior, and there is no hook to adjust the filters thatSetUsageDataBillingFiltersapplies.Two things are needed:
SetRange("Usage Base Pricing", ...)call so it no longer assumes the enum ends atUnit Cost Surcharge. It should include the rangeUsage Quantity..Unit Cost Surchargeplus all values greater thanUnit Cost Surcharge, so custom option values added aboveUnit Cost Surchargeare not excluded.SetUsageDataBillingFiltersso partners can further adjust or extend the filters applied toUsageDataBilling.Proposed change
SetRangeinSetUsageDataBillingFilterswith filtering that coversUsage Quantity..Unit Cost Surchargeand everything aboveUnit Cost Surcharge(for example aSetFilteron the ordinal range plus> Unit Cost Surcharge, or otherwise avoiding the hard upper bound), so custom enum values are not dropped.[IntegrationEvent(false, false)]publisher (e.g.OnAfterSetUsageDataBillingFilters) raised at the end ofSetUsageDataBillingFilters, passingvar UsageDataBilling, the sourceSubscriptionLinerecord, and theBillingFromDate/BillingToDateparameters, so subscribers can add or modify filters.Expected behavior
A dependent extension that adds custom values to enum 8007 "Usage Based Pricing" (once the enum is extensible) gets those records included by the built-in filter instead of an empty recordset, and can subscribe to the new integration event to refine the filters applied to
UsageDataBilling— without needing to override or replace the base filtering logic.Steps to reproduce
not applicable
Additional context
No response
I will provide a fix for a bug