ALAppExtensions icon indicating copy to clipboard operation
ALAppExtensions copied to clipboard

[Event Request] Codeunit 7322 "Create Inventory Pick/Movement" - GetSourceDocHeader

Open MiRo65 opened this issue 6 years ago • 3 comments

Could we please have an Event in Codeunit 7322 function GetSourceHeader to create a Case-ELSE Structure?

Code:

local procedure GetSourceDocHeader()
begin
    case WhseRequest."Source Document" of
        WhseRequest."Source Document"::"Purchase Order":
            begin
                PurchHeader.Get(PurchHeader."Document Type"::Order, WhseRequest."Source No.");
                PostingDate := PurchHeader."Posting Date";
                VendorDocNo := PurchHeader."Vendor Invoice No.";
            end;
        WhseRequest."Source Document"::"Purchase Return Order":
            begin
                PurchHeader.Get(PurchHeader."Document Type"::"Return Order", WhseRequest."Source No.");
                PostingDate := PurchHeader."Posting Date";
                VendorDocNo := PurchHeader."Vendor Cr. Memo No.";
            end;
        WhseRequest."Source Document"::"Sales Order":
            begin
                SalesHeader.Get(SalesHeader."Document Type"::Order, WhseRequest."Source No.");
                PostingDate := SalesHeader."Posting Date";
            end;
        WhseRequest."Source Document"::"Sales Return Order":
            begin
                SalesHeader.Get(SalesHeader."Document Type"::"Return Order", WhseRequest."Source No.");
                PostingDate := SalesHeader."Posting Date";
            end;
        WhseRequest."Source Document"::"Outbound Transfer":
            begin
                TransferHeader.Get(WhseRequest."Source No.");
                PostingDate := TransferHeader."Posting Date";
            end;
        WhseRequest."Source Document"::"Prod. Consumption":
            begin
                ProdHeader.Get(WhseRequest."Source Subtype", WhseRequest."Source No.");
                PostingDate := WorkDate;
            end;
        WhseRequest."Source Document"::"Assembly Consumption":
            begin
                AssemblyHeader.Get(WhseRequest."Source Subtype", WhseRequest."Source No.");
                PostingDate := AssemblyHeader."Posting Date";
            end;
        **// start kvspsa - Event Raiser
        else
            OnWhseRequestGetSourceDocHeaderCaseElse(WhseRequest, PostingDate);
    // stop kvspsa**
    end;
 end;

MiRo65 avatar Dec 13 '19 13:12 MiRo65

This event already exist OnGetSourceDocHeaderFromWhseRequest(WhseRequest, SourceDocRecRef, PostingDate, VendorDocNo);

AlexanderYakunin avatar Jan 13 '20 11:01 AlexanderYakunin

Hi Alexander, we can't find it in CU02, will it be available in CU03?

Michael

MiRo65 avatar Jan 13 '20 12:01 MiRo65

Yes

AlexanderYakunin avatar Jan 13 '20 12:01 AlexanderYakunin