Skip to main content

Notifications

Microsoft Dynamics NAV (Archived)

Revert Posted Item Tracking

(0) ShareShare
ReportReport
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


*This post is locked for comments

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

News and Announcements

Announcing Category Subscriptions!

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,359 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,370 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans