Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Event Request] Codeunit 7110 Analysis Report Management - Procedure CalcQuantity - OnBeforeCalcQuantity #27860

Closed
mavohra opened this issue Dec 30, 2024 · 1 comment
Labels
event-request Request for adding an event SCM GitHub request for SCM area ships-in-future-update Fix ships in a future update

Comments

@mavohra
Copy link

mavohra commented Dec 30, 2024

Describe the request

Please add the event OnBeforeCalcQuantity in procedure CalcQuantity in Codeunit 7110 Analysis Report Management.

local procedure CalcQuantity(var ItemStatisticsBuf: Record "Item Statistics Buffer"; Invoiced: Boolean): Decimal
begin
    OnBeforeCalcQuantity(ItemStatisticsBuf, Invoiced, IsHandled, Result); // <--- New Event
    if IsHandled then 
        exit(Result);

    if ItemStatisticsBuf.GetFilter("Source No. Filter") = '' then
        ItemStatisticsBuf.SetRange("Source Type Filter");

    if AnalysisLineTemplate."Item Analysis View Code" = '' then begin
        ItemStatisticsBuf.SetRange(ItemStatisticsBuf."Entry Type Filter");
        if Invoiced then begin
            ItemStatisticsBuf.CalcFields("Invoiced Quantity");
            exit(ItemStatisticsBuf."Invoiced Quantity");
        end;
        ItemStatisticsBuf.CalcFields(Quantity);
        exit(ItemStatisticsBuf.Quantity);
    end;
    ItemStatisticsBuf.SetRange(ItemStatisticsBuf."Entry Type Filter");
    if Invoiced then begin
        ItemStatisticsBuf.CalcFields("Analysis - Invoiced Quantity");
        exit(ItemStatisticsBuf."Analysis - Invoiced Quantity");
    end;
    ItemStatisticsBuf.CalcFields("Analysis - Quantity");
    exit(ItemStatisticsBuf."Analysis - Quantity");
end;

[IntegrationEvent(false, false)]
local procedure OnBeforeCalcQuantity(var ItemStatisticsBuf: Record "Item Statistics Buffer"; Invoiced: Boolean; var IsHandled: Boolean; var Result: Decimal)
begin
end;

Additional context

Our customization allows handling alternative quantities based on specific conditions and we'd like to make changes in the procedure.

This event request is part of a series of four related event requests for Codeunit 7110 Analysis Report Management. The requested events aim to enable customization of key procedures for handling alternative quantities and budget data.

The four requested events are:

OnBeforeCalcQuantity in the CalcQuantity procedure.
OnBeforeCalcBudgetQuantity in the CalcBudgetQuantity procedure.
OnBeforeDrillDownQuantity in the DrillDownQuantity procedure.
OnBeforeDrillDownBudgetQuantity in the DrillDownBudgetQuantity procedure.

The remaining 3 events will be requested in a separate request.

These events are required to implement custom logic without modifying the base application.

Thank you.
Internal work item: AB#561386

@JakovljevicDusan JakovljevicDusan added event-request Request for adding an event SCM GitHub request for SCM area labels Dec 30, 2024
@JesperSchulz JesperSchulz added the ships-in-future-update Fix ships in a future update label Dec 31, 2024
@JesperSchulz
Copy link
Contributor

Thanks for reporting this. We agree, and we’ll publish a fix asap, either in an update for the current version or in the next major release. Please do not reply to this, as we do not monitor closed issues. If you have follow-up questions or requests, please create a new issue where you reference this one.

Build ID: 28412.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
event-request Request for adding an event SCM GitHub request for SCM area ships-in-future-update Fix ships in a future update
Projects
None yet
Development

No branches or pull requests

3 participants