ALAppExtensions icon indicating copy to clipboard operation
ALAppExtensions copied to clipboard

[Event Request] Codeunit 5760 Whse.-Post Receipt - InsertTempWhseJnlLine

Open ttaeufer opened this issue 7 years ago • 0 comments

Could we have Publisher OnBeforeInsertTempWhseJnlLine (with Handled Pattern) and OnBeforeInsertTempWhseJnlLine in InsertTempWhseJnlLine Codeunit 5760 Whse.-Post Receipt

LOCAL InsertTempWhseJnlLine(PostedWhseRcptLine : Record "Posted Whse. Receipt Line")
OnBeforeInsertTempWhseJnlLine(PostedWhseRcptLine,Handled);

// >>>>>>>>
IF Handled THEN 
  EXIT;
// <<<<<<<<

WITH PostedWhseRcptLine DO BEGIN
  TempWhseJnlLine.INIT;
  TempWhseJnlLine."Entry Type" := TempWhseJnlLine."Entry Type"::"Positive Adjmt.";
  TempWhseJnlLine."Line No." := "Line No.";
  TempWhseJnlLine."Location Code" := "Location Code";
  TempWhseJnlLine."To Zone Code" := "Zone Code";
  TempWhseJnlLine."To Bin Code" := "Bin Code";
  TempWhseJnlLine."Item No." := "Item No.";
  TempWhseJnlLine.Description := Description;
  GetLocation("Location Code");

..

   "Source Document"::"Inbound Transfer":
      BEGIN
        TempWhseJnlLine."Source Code" := SourceCodeSetup.Transfer;
        TempWhseJnlLine."Reference Document" :=
          TempWhseJnlLine."Reference Document"::"Posted T. Receipt";
      END;
  END;

  // >>>>>>>>
  OnBeforeInsertTempWhseJnlLine(PostedWhseRcptLine, TempWhseJnlLine);
  // <<<<<<<<

  ItemTrackingMgt.CheckWhseItemTrkgSetup("Item No.",SNRequired,LNRequired,FALSE);
  IF SNRequired THEN
    TESTFIELD("Qty. per Unit of Measure",1);

  WMSMgt.CheckWhseJnlLine(TempWhseJnlLine,0,0,FALSE);
  TempWhseJnlLine.INSERT;

ttaeufer avatar Feb 04 '19 15:02 ttaeufer