Skip deleting warehouse shipment after posting

samantha73
samantha73 Member Posts: 126

Hi

The system auto delete completly shipped warehouse shipments by default. Is there a way to skip this from AL code ? So the fully sales shipped warehouse shipment satys in system

Answers

  • kriki
    kriki Member, Moderator Posts: 9,135

    Look in procedure PostUpdateWhseDocuments in codeunit 5763 "Whse.-Post Shipment". There are some events you can use to avoid it.

    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • Developer101
    Developer101 Member Posts: 576

    Something like this….

    [EventSubscriber(ObjectType::Codeunit, Codeunit::"Whse.-Post Shipment", 'OnBeforeDeleteUpdateWhseShptLine', '', false, false)] local procedure OnBeforeDeleteUpdateWhseShptLine(WhseShptLine: Record "Warehouse Shipment Line"; var DeleteWhseShptLine: Boolean; var WhseShptLineBuf: Record "Warehouse Shipment Line") begin //Set this flag to false DeleteWhseShptLine := false; end;

    United Kingdom