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 5530 "Calc. Item Availability" - Procedure CalcNewInvtEventBuf - OnBeforeCalcNewInvtEventBuf #28022

Open
mavohra opened this issue Jan 30, 2025 · 0 comments

Comments

@mavohra
Copy link

mavohra commented Jan 30, 2025

Describe the request

Please add an event OnBeforeCalcNewInvtEventBuf in the procedure CalcNewInvtEventBuf in Codeunit 5530 "Calc. Item Availability"

 procedure CalcNewInvtEventBuf(var Item: Record Item; ForecastName: Code[10]; IncludeBlanketOrders: Boolean; ExcludeForecastBefore: Date; 
 IncludePlan: Boolean)
    begin
        if Item.Type <> Item.Type::Inventory then
            exit;
        TempInvtEventBuf.Reset();
        TempInvtEventBuf.DeleteAll();

        
        OnBeforeCalcNewInvtEventBuf(TempInvtEventBuf); // <--- New Event

        GetDocumentEntries(TempInvtEventBuf, Item);
        if (ForecastName <> '') or IncludeBlanketOrders or IncludePlan then
            GetAnticipatedDemand(TempInvtEventBuf, Item, ForecastName, ExcludeForecastBefore, IncludeBlanketOrders);
        if IncludePlan then
            GetPlanningEntries(TempInvtEventBuf, Item);
    end;
    [IntegrationEvent(false, false)]
    local procedure OnBeforeCalcNewInvtEventBuf(var TempInvtEventBuf: Record "Inventory Event Buffer")
    begin
    end;

Additional context

We need to apply additional custom filters and exclusions (e.g., LotStatusExclusionFilter) in the temporary inventory event buffer before GetDocumentEntries procedure is called.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant