Skip to content

codeunit 99000845 "Reservation Management" - New event OnAfterGetItemSetup #29679

@petmoe

Description

@petmoe

Why do you need this change?

We would like to be able to utilize the AutoTrack functionality dynamically when certain conditions are fulfilled without having to set up the item to run AutoTrack all the time. The new events recently added (#29421 and #29424) has allowed us to do this by temporarily changing the "Order Tracking Policy" of the item, and that works really well.
We have however identified some scenarios where the event in Reservation Management is not triggered and in order to complete the design we need a more general event also, ensuring that we always have access to the global Item variable, regardless of how the flow has been initiated.

Describe the request

In codeunit 99000845 "Reservation Management" local procedure GetItemSetup(var ReservEntry: Record "Reservation Entry") we would like a new event OnAfterGetItemSetup, passing the variables ReservEntry and Item as var as shown below.

local procedure GetItemSetup(var ReservEntry: Record "Reservation Entry")
var
    PlanningGetParameters: Codeunit "Planning-Get Parameters";
begin
    if ReservEntry."Item No." <> Item."No." then begin
        Item.Get(ReservEntry."Item No.");
        if Item."Item Tracking Code" <> '' then
            ItemTrackingCode.Get(Item."Item Tracking Code")
        else
            ItemTrackingCode.Init();
        PlanningGetParameters.AtSKU(
          SKU, ReservEntry."Item No.", ReservEntry."Variant Code", ReservEntry."Location Code");  
        //>>New Code Begin
        OnAfterGetItemSetup(ReservEntry, Item);
        //<<New Code End
    end;
end;


//>>New Code Begin
[IntegrationEvent(false, false)]
local procedure OnAfterGetItemSetup(var ReservationEntry: Record "Reservation Entry"; var Item: Record Item)
begin
end;
//<<New Code End

Internal work item: AB#621147

Metadata

Metadata

Assignees

No one assigned

    Labels

    SCMGitHub request for SCM areaevent-requestRequest for adding an event

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions