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