[Extensibility Request] issue 30378: add OnItemVariantOnAfterGetRecordOnBeforePrintOnlyIfSalesCheck event in Item Sales Statistics report - #9774
Conversation
…lyIfSalesCheck event in Item Sales Statistics report Co-authored-by: Copilot <[email protected]>
|
@copilot |
…rGetRecordOnBeforePrintOnlyIfSalesCheck
Fixed in the latest commit — |
qasimikram
left a comment
There was a problem hiding this comment.
S1 - Clearing SkipRecord here does not control the final decision: the same trigger later calls CurrReport.Skip when all standard quantity/value fields are zero. That is precisely possible for alternate-UOM extension sales. Move the publisher after the return calculation or expose the final skip decision, and test zero standard sales with nonzero extension sales.
S2 - The parent Item trigger can skip before the Item Variant dataitem runs, so this publisher depends on the companion item-level hook. Deliver the hooks together or otherwise ensure the variant event is reachable for the documented scenario.
S3 - Pass ItemVariant by value. Allowing mutation after SetRange and CalcFields can combine values calculated for one variant with a different variant code used by later logic.
Summary
When "Only Items with Sales" and "Breakdown By Variant" are both enabled on the Item Sales Statistics report (10135), the base report decides, per item variant, whether to skip a row based solely on
Item."Sales (Qty.)"and the privatePrintOnlyIfSalesflag. Extensions that compute their own sales figures (for example alternate unit-of-measure quantities) cannot influence this decision becausePrintOnlyIfSaleshas no accessible getter and the skip is evaluated before any extension trigger runs. This PR exposes the already-computed skip decision through a new integration event at the variant level so subscribers can fold in their own figures.Source issue repository: microsoft/AlAppExtensions; issue number: 30378
Changes Made
OnItemVariantOnAfterGetRecordOnBeforePrintOnlyIfSalesCheck- new integration event raised in theItem VariantOnAfterGetRecordtrigger afterItem.CalcFieldsand before theCurrReport.Skip()check; the inline skip condition now assigns aSkipRecordboolean that the event can override viavar, exposingItem,ItemVariant, andPrintOnlyIfSalesto subscribers.Fixes AB#644154