ALAppExtensions icon indicating copy to clipboard operation
ALAppExtensions copied to clipboard

To skip testfield(Quantity) in Service Line - Field "Line Discount Amount"

Open srinivasGangadhara opened this issue 5 years ago • 4 comments

Hi

we need to Handle Quantity in service line Line Discount Amount OnValidate trigger, for that we need as below Event,

image

Thanks! Regards Srinivas

srinivasGangadhara avatar Jun 18 '21 04:06 srinivasGangadhara

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.

StanPesotskiy avatar Jun 18 '21 06:06 StanPesotskiy

Here you can find the parameters

OnValidate Trigger:

**field(103; "Line Amount"; Decimal) { AutoFormatExpression = "Currency Code"; AutoFormatType = 1; CaptionClass = GetCaptionClass(FieldNo("Line Amount")); Caption = 'Line Amount';

        trigger OnValidate()
        var
            ServAmountsMgt: Codeunit "Serv-Amounts Mgt.";
            LineDiscountAmountExpected: Decimal;
            Handle: Boolean;
        begin
            TestField(Type);
            OnBeforeQuantityTestfield(Rec, xRec, Handle);
            if not Handle then
                TestField(Quantity);
            TestField("Unit Price");
            Currency.Initialize("Currency Code");
            "Line Amount" := Round("Line Amount", Currency."Amount Rounding Precision");
            LineDiscountAmountExpected := Round(CalcChargeableQty * "Unit Price", Currency."Amount Rounding Precision") - "Line Amount";
            if ServAmountsMgt.AmountsDifferByMoreThanRoundingPrecision(LineDiscountAmountExpected, "Line Discount Amount", Currency."Amount Rounding Precision") then
                Validate("Line Discount Amount", LineDiscountAmountExpected);
            GetServHeader();
            if ServHeader."Tax Area Code" = '' then
                UpdateVATAmounts;
        end;
    }**

IntegrationEvent:

[IntegrationEvent(false, false)] local procedure OnBeforeQuantityTestfield(var ServiceLine: Record "Service Line"; var xServiceLine: Record "Service Line";Handled: Boolean) begin end;

srinivasGangadhara avatar Jun 18 '21 06:06 srinivasGangadhara

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 Jun 29 '21 05:06 JesperSchulz

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 Jun 30 '21 15:06 JesperSchulz