microsoft / ALAppExtensions

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

[Event Request] Codeunit 140 EC Sales List Suggest Lines #14693

Closed RichardPostborg closed 3 years ago

RichardPostborg commented 3 years ago

We would like to be able to adjust lines and this could be dione by adding a event request in the Procedure AddOrUpdateECLLine with the IsHandled trigger to exit.

image

and the trigger itself (NOTE that ECSLVATReportLine and IsHandled is VAR declared

image

Best regard

Richard

Oleg-Romashkov commented 3 years ago

Please always put the full detailed signature of the requested events and the parameters passed in the call. You help us implementing the requests faster when your request contains AL code copied from VSCode instead of screenshots.

RichardPostborg commented 3 years ago

Here the code is // indicates start / end.

local procedure AddOrUpdateECLLine(EUVATEntries: Query "EU VAT Entries")
var
    ECSLVATReportLine: Record "ECSL VAT Report Line";
    isHandled: Boolean;
begin
    // ->
    OnBeforeAddUpdateECLLine(EUVATEntries, ECSLVATReportLine, isHandled);
    if isHandled then 
        exit;
    // <-

    GetECLLine(ECSLVATReportLine, EUVATEntries);
    ECSLVATReportLine."Total Value Of Supplies" += EUVATEntries.Base;
    AddToRepLineRelation(EUVATEntries, ECSLVATReportLine);
    ECSLVATReportLine.Modify(true);
end;

and the publisher itself

 // ->
[IntegrationEvent(false, false)]

local procedure OnBeforeAddUpdateECLLine(EUVATEntries: Query "EU VAT Entries"; var ECSLVATReportLine: Record "ECSL VAT Report Line"; isHandled: Boolean)
begin
end;
// <-

Best regards

Richard

JesperSchulz commented 3 years 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.