microsoft / ALAppExtensions

Repository for collaboration on Microsoft AL application add-on and localization extensions for Microsoft Dynamics 365 Business Central.
MIT License
768 stars 610 forks source link

[Event Request] Table 37 Sales Line - Procedure CalcShipmentDateForLocation - OnBeforeCalcShipmentDateForLocation #26940

Closed MH1612 closed 3 weeks ago

MH1612 commented 1 month ago

Describe the request

Please add the following Event/-s OnBeforeCalcShipmentDateForLocation to Procedure CalcShipmentDateForLocation in Table 37 Sales Line.

[Event Request] Table 37 Sales Line - Procedure CalcShipmentDateForLocation - OnBeforeCalcShipmentDateForLocation
    var
        CustomCalendarChange: Array[2] of Record "Customized Calendar Change";
    begin
        IsHandled := FALSE;
        OnBeforeCalcShipmentDateForLocation(Rec,xRec,IsHandled);
        IF Ishandled THEN
          EXIT;

        CustomCalendarChange[1].SetSource(CalChange."Source Type"::Location, "Location Code", '', '');
        "Shipment Date" := CalendarMgmt.CalcDateBOC('', SalesHeader."Shipment Date", CustomCalendarChange, false);
    end;
 [IntegrationEvent(false, false)]
 local procedure OnBeforeCalcShipmentDateForLocation(var SalesLine : Record "Sales Line",xSalesLine : Record "Sales Line",var IsHandled : Boolean)
    begin
    end;

Additional context

Skip the Calculation Internal work item: AB#543560

azure-boards[bot] commented 1 month ago

✅ Successfully linked to Azure Boards work item(s):

AleksandricMarko commented 1 month ago

@MH1612 There are already events which can be used

Why you need a new one?

SKeiler commented 1 month ago

Hi @AleksandricMarko ,

we want to skip all executions of the procedure, also if it's called from an extension etc. We use the both named procedures currently only as workaround.

And every such kind of procedure should have a OnPre-Event. Isn't there also a styleguide for this (or something similar)? In my opinion the both events before the procedure call could be deleted and replaced with an event in the procedure.

JesperSchulz commented 3 weeks ago

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: 23098.