Make usage data billing filtering extensible in SetUsageDataBillingFilters#9225
Open
miljance wants to merge 1 commit into
Open
Make usage data billing filtering extensible in SetUsageDataBillingFilters#9225miljance wants to merge 1 commit into
miljance wants to merge 1 commit into
Conversation
…lters The local procedure SetUsageDataBillingFilters on table 8059 "Subscription Line" filtered "Usage Base Pricing" with a bounded SetRange from "Usage Quantity" to "Unit Cost Surcharge". That upper bound assumed the enum 8007 "Usage Based Pricing" ended at "Unit Cost Surcharge", so any custom values a partner adds above it were silently excluded, which could leave the recordset empty. - Replace the bounded SetRange with SetFilter '>=%1' from "Usage Quantity", which still excludes "None" but includes all current and custom values. - Add integration event OnAfterSetUsageDataBillingFilters so subscribers can refine the applied filters without overriding the base logic. Fixes microsoft#9223 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
SetUsageDataBillingFilterson table 8059 "Subscription Line" filtered"Usage Base Pricing"with a boundedSetRangefrom"Usage Quantity"to"Unit Cost Surcharge". That upper bound assumed enum 8007"Usage Based Pricing"ends at"Unit Cost Surcharge", so any custom value a partner adds above it fell outside the range and was silently excluded — potentially returning an emptyUsage Data Billingrecordset. There was also no hook for partners to adjust the applied filters.This change:
SetRangewithSetFilter("Usage Base Pricing", '>=%1', Enum::"Usage Based Pricing"::"Usage Quantity"). This preserves the original behavior (still excludes"None") while remaining open-ended, so custom enum values are included instead of dropped.OnAfterSetUsageDataBillingFilters(var UsageDataBilling; SubscriptionLine; BillingFromDate; BillingToDate)at the end of the procedure so subscribers can refine the filters without overriding the base logic.Linked work
Fixes #9223
How I validated this
What I tested and the outcome
Change is a small, self-contained filter adjustment plus a new integration event publisher. The new filter
>=%1from"Usage Quantity"is logically equivalent to the previous"Usage Quantity".."Unit Cost Surcharge"range for all shipped enum values (ordinals 1–3), and additionally includes any partner-added values (ordinal ≥ 4) that the old bounded range excluded;"None"(ordinal 0) remains excluded.Risk & compatibility
Low. For the enum values that ship today the filter result is unchanged. The only behavioral difference is that
"Usage Base Pricing"values above"Unit Cost Surcharge"are now included rather than excluded — which is the intended fix. The newOnAfterSetUsageDataBillingFiltersevent is additive.