Skip to content

[Event Request] Table 39 "Purchase Line" - OnValidateBinCodeOnBeforeTestFields #30112

@KlaasKleermaker

Description

@KlaasKleermaker

Why do you need this change?

In 4PS Construct we need to skip TestField(Type, Type::Item) in some cases. In table 37 "Sales Line" the event OnValidateBinCodeOnBeforeTestFields makes it possible to skip this TestField. This should also be possible in "Purchase Line".

Describe the request

Dear ALAppExtensions team,

On behalf of 4PS I would like to request integration event 'OnValidateBinCodeOnBeforeTestFields' to be added to the OnValidate trigger of field "Bin Code" in table 39 "Purchase Line".

            trigger OnValidate()
            var
                Item: Record Item;
                WMSManagement: Codeunit "WMS Management";
                IsHandled: Boolean; //new
            begin
                if "Bin Code" <> '' then
                    if not IsInbound() and ("Quantity (Base)" <> 0) then
                        WMSManagement.FindBinContent("Location Code", "Bin Code", "No.", "Variant Code", '')
                    else
                        WMSManagement.FindBin("Location Code", "Bin Code", '');

                if "Drop Shipment" then
                    ShowBinCodeCannotBeChangedError();

                IsHandled := false; //new
                OnValidateBinCodeOnBeforeTestFields(Rec, IsHandled); //new
                if IsHandled then //new
                    exit; //new

                TestField(Type, Type::Item);
                TestField("Location Code");

                GetItem(Item);
                Item.TestField(Type, Item.Type::Inventory);

                if "Bin Code" <> '' then begin
                    GetLocation("Location Code");
                    Location.TestField("Bin Mandatory");
                    CheckWarehouse(true);
                end;
            end;
        }
    [IntegrationEvent(false, false)]
    local procedure OnValidateBinCodeOnBeforeTestFields(var PurchaseLine: Record "Purchase Line"; var IsHandled: Boolean)
    begin
	    //new
    end;

Internal work item: AB#636254

Metadata

Metadata

Assignees

No one assigned

    Labels

    SCMGitHub request for SCM areaevent-requestRequest for adding an event

    Type

    No fields configured for Task.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions