Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[EventRequest] Codeunit 5817 Undo Posting Management - OnAfterRevertPostedItemTracking #7543

Closed
fvanderhek opened this issue Jun 25, 2020 · 1 comment
Labels
event-request Request for adding an event ships-in-future-update Fix ships in a future update

Comments

@fvanderhek
Copy link

Requesting a new event publisher on Codeunit 5817 Undo Posting Management

Event
OnAfterRevertPostedItemTracking(VAR TEMPORARY TempReservEntry)

Code

LOCAL RevertPostedItemTracking(VAR TempItemLedgEntry : TEMPORARY Record "Item Ledger Entry";AvailabilityDate : Date)

WITH TempItemLedgEntry DO BEGIN
  IF FIND('-') THEN BEGIN
    REPEAT
      TrackingSpecification.GET("Entry No.");
      IF NOT TrackingIsATO(TrackingSpecification) THEN BEGIN
        ReservEntry.INIT;
        ReservEntry.TRANSFERFIELDS(TrackingSpecification);
        ReservEntry.VALIDATE("Quantity (Base)");
        ReservEntry."Reservation Status" := ReservEntry."Reservation Status"::Surplus;
        IF ReservEntry.Positive THEN
          ReservEntry."Expected Receipt Date" := AvailabilityDate
        ELSE
          ReservEntry."Shipment Date" := AvailabilityDate;
        ReservEntry."Entry No." := 0;
        ReservEntry.UpdateItemTracking;
        ReservEntry.INSERT;

        TempReservEntry := ReservEntry;
        TempReservEntry.INSERT;
      END;
      TrackingSpecification.DELETE;
    UNTIL NEXT = 0;
    ReservEngineMgt.UpdateOrderTracking(TempReservEntry);
  END;
END; // WITH

>>> New Code

OnAfterRevertPostedItemTracking(TempReservEntry);

<<< New Code End

In Our Solution we work with Job Deliveries (Sales Order + Lines) and packing Lines (Custom Table linked to those Sales Lines). In the Packing Lines we split Serial Tracked items per 1 (So an one to many relation is crested). In each line a Serial No. needs to be specified. When we process the packing lines these specified Serial Nos. will be transferred to the Item Tracking Lines below the Sales Line. When we undo a Sales Shipment the tracking lines are restored as not posted. We need the possibility to delete these Item tracking lines in the process of undoing Sales Shipment, because we will create new Paking Lines and are going to create new Tracking Lines below the Sales Line. Please add the requested Publisher.
It is also possible to undo Posted Shipments with Job Information. In that scenario we need to have the flexibility to also generate a Job Ledger Entry linked to that action (Negative Usage) to get a correct picture on the Sub Administration Jobs. Also the Cost amount of the undo shipment must also be processed correctly for that specific Job. Please add the requested publisher.

@StanPesotskiy StanPesotskiy added the event-request Request for adding an event label Jun 25, 2020
@bc-ghost bc-ghost added the ships-in-future-update Fix ships in a future update label Jun 30, 2020
@bc-ghost
Copy link

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. We will update this issue with information about availability.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
event-request Request for adding an event ships-in-future-update Fix ships in a future update
Projects
None yet
Development

No branches or pull requests

3 participants