ALAppExtensions icon indicating copy to clipboard operation
ALAppExtensions copied to clipboard

[Event Request] Codeunit 7312 "CreatePick" new event publisher

Open SPinkow opened this issue 4 years ago • 1 comments

Hi, we need a new Publisher in procedure ValidateQtyForSN in codeunit "CreatePick". Current Code of 19.4 is the following:

    local procedure ValidateQtyForSN(WhseItemTrackingLine: Record "Whse. Item Tracking Line")
    begin
        if not (WhseItemTrackingLine."Quantity (Base)" in [-1, 0, 1]) then
            Error(ValidValuesIfSNDefinedErr, WhseItemTrackingLine.FieldCaption("Quantity (Base)"), WhseItemTrackingLine."Quantity (Base)");

        if not (WhseItemTrackingLine."Qty. to Handle (Base)" in [-1, 0, 1]) then
            Error(ValidValuesIfSNDefinedErr, WhseItemTrackingLine.FieldCaption("Qty. to Handle (Base)"), WhseItemTrackingLine."Qty. to Handle (Base)");
    end;

After adding the event the code should be as followed:

    local procedure ValidateQtyForSN(WhseItemTrackingLine: Record "Whse. Item Tracking Line")
    var
        IsHandled: Boolean;
    begin
        OnBeforeValidateQtyForSN(WhseItemTrackingLine,IsHandled);
        if IsHandled then
            exit;

        if not (WhseItemTrackingLine."Quantity (Base)" in [-1, 0, 1]) then
            Error(ValidValuesIfSNDefinedErr, WhseItemTrackingLine.FieldCaption("Quantity (Base)"), WhseItemTrackingLine."Quantity (Base)");

        if not (WhseItemTrackingLine."Qty. to Handle (Base)" in [-1, 0, 1]) then
            Error(ValidValuesIfSNDefinedErr, WhseItemTrackingLine.FieldCaption("Qty. to Handle (Base)"), WhseItemTrackingLine."Qty. to Handle (Base)");
    end;
    
    [IntegrationEvent(false, false)]
    local procedure OnBeforeValidateQtyForSN(WhseItemTrackingLine: Record "Whse. Item Tracking Line";var IsHandled: Boolean)
    begin
    end;

Could you please add the OnBeforeValidateQtyForSN publisher to the procedure? Thanks in advanced!

SPinkow avatar Feb 23 '22 15:02 SPinkow

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 Feb 28 '22 14:02 JesperSchulz