Skip to content

[Extensibility Request] issue 30378: add OnItemVariantOnAfterGetRecordOnBeforePrintOnlyIfSalesCheck event in Item Sales Statistics report - #9774

Open
AleksandricMarko wants to merge 2 commits into
mainfrom
ai-ext-fix/ext_issue-30378
Open

[Extensibility Request] issue 30378: add OnItemVariantOnAfterGetRecordOnBeforePrintOnlyIfSalesCheck event in Item Sales Statistics report#9774
AleksandricMarko wants to merge 2 commits into
mainfrom
ai-ext-fix/ext_issue-30378

Conversation

@AleksandricMarko

@AleksandricMarko AleksandricMarko commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

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 private PrintOnlyIfSales flag. Extensions that compute their own sales figures (for example alternate unit-of-measure quantities) cannot influence this decision because PrintOnlyIfSales has 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 the Item Variant OnAfterGetRecord trigger after Item.CalcFields and before the CurrReport.Skip() check; the inline skip condition now assigns a SkipRecord boolean that the event can override via var, exposing Item, ItemVariant, and PrintOnlyIfSales to subscribers.

Fixes AB#644154

…lyIfSalesCheck event in Item Sales Statistics report

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@AleksandricMarko

Copy link
Copy Markdown
Contributor Author

@copilot
in local procedure OnItemVariantOnAfterGetRecordOnBeforePrintOnlyIfSalesCheck(var Item: Record Item; ItemVariant: Record "Item Variant"; PrintOnlyIfSales: Boolean; var SkipRecord: Boolean) paremeter Itemvariant should be with VAR

Copilot AI commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

@copilot
in local procedure OnItemVariantOnAfterGetRecordOnBeforePrintOnlyIfSalesCheck(var Item: Record Item; ItemVariant: Record "Item Variant"; PrintOnlyIfSales: Boolean; var SkipRecord: Boolean) ...

Fixed in the latest commit — ItemVariant now has the var modifier: var ItemVariant: Record "Item Variant".

@AleksandricMarko
AleksandricMarko marked this pull request as ready for review July 28, 2026 09:59
@AleksandricMarko
AleksandricMarko requested a review from a team July 28, 2026 09:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

event-request SCM GitHub request for SCM area

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants