ALAppExtensions icon indicating copy to clipboard operation
ALAppExtensions copied to clipboard

[Event Request] Table 336 "Tracking Specification", Field 5811 "Appl.-from Item Entry": OnValidateApplFromItemEntryOnBeforeFieldErrorSourceType

Open nd2403 opened this issue 5 years ago • 1 comments

Hello, we need to include new tables into item tracking, thanks in advance.

field(5811; "Appl.-from Item Entry"; Integer)
        {
            Caption = 'Appl.-from Item Entry';
            MinValue = 0;

           trigger OnValidate()
            var
                ItemLedgEntry: Record "Item Ledger Entry";
            begin
                if "Appl.-from Item Entry" = 0 then
                    exit;

                case "Source Type" of
                    DATABASE::"Sales Line":
                        if (("Source Subtype" in [3, 5]) and ("Quantity (Base)" < 0)) or
                           (("Source Subtype" in [1, 2]) and ("Quantity (Base)" > 0)) // sale
                        then
                            FieldError("Quantity (Base)");
                    DATABASE::"Item Journal Line":
                        if (("Source Subtype" in [0, 2, 6]) and ("Quantity (Base)" < 0)) or
                           (("Source Subtype" in [1, 3, 4, 5]) and ("Quantity (Base)" > 0))
                        then
                            FieldError("Quantity (Base)");
                    DATABASE::"Service Line":
                        if (("Source Subtype" in [3]) and ("Quantity (Base)" < 0)) or
                           (("Source Subtype" in [1, 2]) and ("Quantity (Base)" > 0))
                        then
                            FieldError("Quantity (Base)");
                    DATABASE::"Invt. Document Line":
                        if (("Source Subtype" in [1, 3, 4, 5]) and ("Quantity (Base)" < 0)) or
                           (("Source Subtype" in [0, 2, 6]) and ("Quantity (Base)" > 0))
                        then
                            FieldError("Quantity (Base)");
// - changed
                   // else
                   //      FieldError("Source Subtype");
                    else begin
                            IsHandeld := false;
                            OnValidateApplFromItemEntryOnBeforeFieldErrorSourceType(Rec, IsHandeld);
                            if not IsHandeld then
                                FieldError("Source Subtype");
                        end;
 // + changed
                end;
    [IntegrationEvent(false, false)]
    local procedure OnValidateApplFromItemEntryOnBeforeFieldErrorSourceType(var TrackingSpecification: Record "Tracking Specification"; var IsHandeld: Boolean)
    begin
    end;

nd2403 avatar Nov 17 '21 13:11 nd2403

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 Nov 25 '21 05:11 JesperSchulz