ALAppExtensions icon indicating copy to clipboard operation
ALAppExtensions copied to clipboard

[Event Request] Table 5902 "Service Line" - OnBeforeLineDiscountAmount

Open Pepito-lab opened this issue 5 years ago • 2 comments

Hi, would it be possible to get an event OnBeforeLineDiscountAmount Table 5902 "Service Line", like this :

        field(28; "Line Discount Amount"; Decimal)
        {
            AutoFormatExpression = "Currency Code";
            AutoFormatType = 1;
            Caption = 'Line Discount Amount';

            trigger OnValidate()
            begin
                TestStatusOpen;
                GetServHeader;
                TestField(Quantity);
                if "Line Discount Amount" <> xRec."Line Discount Amount" then begin
                    OnBeforeLineDiscountAmount(Rec, Currency);
                    UpdateLineDiscPct;
                end;
                "Inv. Discount Amount" := 0;
                "Inv. Disc. Amount to Invoice" := 0;
                Validate("Line Discount %");
            end;
        }
    [IntegrationEvent(false, false)]
    local procedure OnBeforeLineDiscountAmount(var Rec: Record "Service Line"; var Currency: record 4)
    begin
    end;

Thanks!

Pepito-lab avatar May 05 '21 07:05 Pepito-lab

There is already a OnBeforeUpdateLineDiscPct in UpdateLineDiscPct procedure which is called only from here and has the params you are requesting. You should use that event

Stepanenko-Vadim avatar May 13 '21 06:05 Stepanenko-Vadim

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.

JesperSchulz avatar May 14 '21 05:05 JesperSchulz