Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics NAV forum
Unanswered

Revert Posted Item Tracking

Posted on by Microsoft Employee

Hi all,

I have a situation in which i have shipped some items from my Sales Order.

I had a custom report which when i did print my Posted Sales Shipment , it deleted tracking specification( by mistake).

So now i have no Tracking Specification for that shipment.

I want to undo the shipment but i am getting errors while trying to get Tracking Specification, which is fair since i have no entries.

I i comment out the RevertPostedItemTracking Method , it works just fine. Am i going to miss something important if i skip this step or i can give it a go?

The Function : 

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


Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Anton Venter – Community Spotlight

Kudos to our October Community Star of the month!

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,564 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,651 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans