Applies To
Dynamics NAV 2009

This article applies to Microsoft for all countries and all language locales.

Symptoms

Assume that you create a production order for an item from a sales order in Microsoft Dynamics NAV 2009. You cancel the reservation quantity for the production order. In this situation, when you post the output for the production order, you receive the following error message:

The Reservation Entry does not exist. Identification fields and values:Entry No.='entry number',Positive='No'.

This problem occurs in the following products:

  • Microsoft Dynamics NAV 2009 R2

  • Microsoft Dynamics NAV 2009 Service Pack 1

Resolution

Hotfix information

A supported hotfix is now available from Microsoft. However, it is only intended to correct the problem that is described in this article. Apply it only to systems that are experiencing this specific problem. This hotfix may receive additional testing. Therefore, if you are not severely affected by this problem, we recommend that you wait for the next Microsoft Dynamics NAV 2009 service pack or the next Microsoft Dynamics NAV version that contains this hotfix. Note In special cases, charges that are ordinarily incurred for support calls may be canceled if a Technical Support Professional for Microsoft Dynamics and related products determines that a specific update will resolve your problem. The usual support costs will apply to additional support questions and issues that do not qualify for the specific update in question.

Installation information

Microsoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements.Note Before you install this hotfix, verify that all Microsoft Navision client users are logged off the system. This includes Microsoft Navision Application Services (NAS) client users. You should be the only client user who is logged on when you implement this hotfix.To implement this hotfix, you must have a developer license.We recommend that the user account in the Windows Logins window or in the Database Logins window be assigned the "SUPER" role ID. If the user account cannot be assigned the "SUPER" role ID, you must verify that the user account has the following permissions:

  • The Modify permission for the object that you will be changing.

  • The Execute permission for the System Object ID 5210 object and for the System Object ID 9015 object.

Note You do not have to have rights to the data stores unless you have to perform data repair.

Code changes

Note Always test code fixes in a controlled environment before you apply the fixes to your production computers. To resolve this problem, follow these steps:

  1. Change the code in the Controls in the Reservation Entries form (497) as follows:Existing code

    ...Text004 +Text005,FALSE,ReservEntry."Quantity (Base)",ReservEntry."Item No.",ReservEngineMgt.CreateForText(Rec),ReservEngineMgt.CreateFromText(Rec))THEN BEGIN// Delete the following line.ReservEngineMgt.CloseReservEntry2(ReservEntry);COMMIT;END;UNTIL ReservEntry.NEXT = 0;END;}...

    Replacement code

    ...Text004 +Text005,FALSE,ReservEntry."Quantity (Base)",ReservEntry."Item No.",ReservEngineMgt.CreateForText(Rec),ReservEngineMgt.CreateFromText(Rec))THEN BEGIN// Add the following line.ReservEngineMgt.CancelReservation(ReservEntry);COMMIT;END;UNTIL ReservEntry.NEXT = 0;END;}...
  2. Change the code in the Controls in the Reservation form (498) as follows:Existing code

    ...ReservEntry2.SETRANGE("Reservation Status",ReservEntry2."Reservation Status"::Reservation);IF ReservEntry2.FIND('-') THENREPEATReservEntry3.GET(ReservEntry2."Entry No.",NOT ReservEntry2.Positive);IF RelatesToSummEntry(ReservEntry3,Rec) THEN BEGIN// Delete the following line.ReservEngineMgt.CloseReservEntry2(ReservEntry2);RecordsFound := TRUE;END;UNTIL ReservEntry2.NEXT = 0;IF RecordsFound THEN...

    Replacement code

    ...ReservEntry2.SETRANGE("Reservation Status",ReservEntry2."Reservation Status"::Reservation);IF ReservEntry2.FIND('-') THENREPEATReservEntry3.GET(ReservEntry2."Entry No.",NOT ReservEntry2.Positive);IF RelatesToSummEntry(ReservEntry3,Rec) THEN BEGIN// Add the following line.ReservEngineMgt.CancelReservation(ReservEntry2);RecordsFound := TRUE;END;UNTIL ReservEntry2.NEXT = 0;IF RecordsFound THEN...
  3. Change the code in the Controls in the Available - Sales Lines form (499) as follows:Existing code

    ...ReserveSalesLine.FilterReservFor(ReservEntry2,Rec);IF ReservEntry2.FIND('-') THEN BEGINUpdateReservMgt;REPEAT// Delete the following line.ReservEngineMgt.CloseReservEntry2(ReservEntry2);UNTIL ReservEntry2.NEXT = 0;UpdateReservFrom;END;END;...

    Replacement code

    ...ReserveSalesLine.FilterReservFor(ReservEntry2,Rec);IF ReservEntry2.FIND('-') THEN BEGINUpdateReservMgt;REPEAT// Add the following line.ReservEngineMgt.CancelReservation(ReservEntry2);UNTIL ReservEntry2.NEXT = 0;UpdateReservFrom;END;END;...
  4. Change the code in the Controls in the Available - Requisition Lines form (500) as follows:Existing code

    ...ReserveReqLine.FilterReservFor(ReservEntry2,Rec);IF ReservEntry2.FIND('-') THEN BEGINUpdateReservMgt;REPEAT// Delete the following line.ReservEngineMgt.CloseReservEntry2(ReservEntry2);UNTIL ReservEntry2.NEXT = 0;UpdateReservFrom;END;END;...

    Replacement code

    ...ReserveReqLine.FilterReservFor(ReservEntry2,Rec);IF ReservEntry2.FIND('-') THEN BEGINUpdateReservMgt;REPEAT// Add the following line.ReservEngineMgt.CancelReservation(ReservEntry2);UNTIL ReservEntry2.NEXT = 0;UpdateReservFrom;END;END;...
  5. Change the code in the Controls in the Available - Purchase Lines form (501) as follows:Existing code

    ...ReservePurchLine.FilterReservFor(ReservEntry2,Rec);IF ReservEntry2.FIND('-') THEN BEGINUpdateReservMgt;REPEAT// Delete the following line.ReservEngineMgt.CloseReservEntry2(ReservEntry2);UNTIL ReservEntry2.NEXT = 0;UpdateReservFrom;END;END;...

    Replacement code

    ...ReservePurchLine.FilterReservFor(ReservEntry2,Rec);IF ReservEntry2.FIND('-') THEN BEGINUpdateReservMgt;REPEAT// Add the following line.ReservEngineMgt.CancelReservation(ReservEntry2);UNTIL ReservEntry2.NEXT = 0;UpdateReservFrom;END;END;...
  6. Change the code in the Controls in the Available - Item Journal Lines form (502) as follows:Existing code

    ...ReservEntry2.COPY(ReservEntry);ReserveItemJnlLine.FilterReservFor(ReservEntry2,Rec);IF ReservEntry2.FIND('-') THEN BEGINUpdateReservMgt;REPEAT// Delete the following line.ReservEngineMgt.CloseReservEntry2(ReservEntry2);UNTIL ReservEntry2.NEXT = 0;UpdateReservFrom;END;END;...

    Replacement code

    ...ReservEntry2.COPY(ReservEntry);ReserveItemJnlLine.FilterReservFor(ReservEntry2,Rec);IF ReservEntry2.FIND('-') THEN BEGINUpdateReservMgt;REPEAT// Add the following line.ReservEngineMgt.CancelReservation(ReservEntry2);UNTIL ReservEntry2.NEXT = 0;UpdateReservFrom;END;END;...
  7. Change the code in the Controls in the Available - Item Ledg. Entries form (504) as follows:Existing code

    ...ERROR(Text99000000);ReservEntry2.SETRANGE("Expected Receipt Date");IF ReservEntry2.FIND('-') THEN BEGINUpdateReservMgt;REPEAT// Delete the following line.ReservEngineMgt.CloseReservEntry2(ReservEntry2);UNTIL ReservEntry2.NEXT = 0;TotalAvailQty := TotalAvailQty + QtyReservedThisLine;MaxQtyToReserve := MaxQtyToReserve + QtyReservedThisLine;UpdateReservFrom;...

    Replacement code

    ...ERROR(Text99000000);ReservEntry2.SETRANGE("Expected Receipt Date");IF ReservEntry2.FIND('-') THEN BEGINUpdateReservMgt;REPEAT// Add the following line.ReservEngineMgt.CancelReservation(ReservEntry2);UNTIL ReservEntry2.NEXT = 0;TotalAvailQty := TotalAvailQty + QtyReservedThisLine;MaxQtyToReserve := MaxQtyToReserve + QtyReservedThisLine;UpdateReservFrom;...
  8. Change the code in the Controls in the Available - Service Lines form (5999) as follows:Existing code

    ...ReserveServiceInvLine.FilterReservFor(ReservEntry2,Rec);IF ReservEntry2.FIND('-') THEN BEGINUpdateReservMgt;REPEAT// Delete the following line.ReservEngineMgt.CloseReservEntry2(ReservEntry2);UNTIL ReservEntry2.NEXT = 0;UpdateReservFrom;END;END;...

    Replacement code

    ...ReserveServiceInvLine.FilterReservFor(ReservEntry2,Rec);IF ReservEntry2.FIND('-') THEN BEGINUpdateReservMgt;REPEAT// Add the following line.ReservEngineMgt.CancelReservation(ReservEntry2);UNTIL ReservEntry2.NEXT = 0;UpdateReservFrom;END;END;...
  9. Change the code in the Controls in the Avail. - Item Tracking Lines form (6503) as follows:Existing code

    ...OnPush=BEGINIF NOT EnableReservations THENEXIT;IF NOT CONFIRM(Text001,FALSE) THENEXIT;// Delete the following line.ReservEngineMgt.CloseReservEntry2(Rec);UpdateReservFrom;END;}{ ID=36;ShortCutKey=Shift+F5;...

    Replacement code

    ...OnPush=BEGINIF NOT EnableReservations THENEXIT;IF NOT CONFIRM(Text001,FALSE) THENEXIT;// Add the following line.ReservEngineMgt.CancelReservation(Rec);UpdateReservFrom;END;}{ ID=36;ShortCutKey=Shift+F5;...
  10. Change the code in the Controls in the Available - Transfer Lines form (99000896) as follows:Existing code

    ...ReserveTransLine.FilterReservFor(ReservEntry2,Rec,Direction);IF ReservEntry2.FIND('-') THEN BEGINUpdateReservMgt;REPEAT// Delete the following line.ReservEngineMgt.CloseReservEntry2(ReservEntry2);UNTIL ReservEntry2.NEXT = 0;UpdateReservFrom;END;END;...

    Replacement code

    ...ReserveTransLine.FilterReservFor(ReservEntry2,Rec,Direction);IF ReservEntry2.FIND('-') THEN BEGINUpdateReservMgt;REPEAT// Add the following line.ReservEngineMgt.CancelReservation(ReservEntry2);UNTIL ReservEntry2.NEXT = 0;UpdateReservFrom;END;END;...
  11. Change the code in the Controls in the Available - Prod. Order Lines form (99000897) as follows:Existing code

    ...ReserveProdOrderLine.FilterReservFor(ReservEntry2,Rec);IF ReservEntry2.FIND('-') THEN BEGINUpdateReservMgt;REPEAT// Delete the following line.ReservEngineMgt.CloseReservEntry2(ReservEntry2);UNTIL ReservEntry2.NEXT = 0;UpdateReservFrom;END;END;...

    Replacement code

    ...ReserveProdOrderLine.FilterReservFor(ReservEntry2,Rec);IF ReservEntry2.FIND('-') THEN BEGINUpdateReservMgt;REPEAT// Add the following line.ReservEngineMgt.CancelReservation(ReservEntry2);UNTIL ReservEntry2.NEXT = 0;UpdateReservFrom;END;END;...
  12. Change the code in the Controls in the Available - Prod. Order Comp. form (99000898) as follows:Existing code

    ...ReserveProdOrderComp.FilterReservFor(ReservEntry2,Rec);IF ReservEntry2.FIND('-') THEN BEGINUpdateReservMgt;REPEAT// Delete the following line.ReservEngineMgt.CloseReservEntry2(ReservEntry2);UNTIL ReservEntry2.NEXT = 0;UpdateReservFrom;END;END;...

    Replacement code

    ...ReserveProdOrderComp.FilterReservFor(ReservEntry2,Rec);IF ReservEntry2.FIND('-') THEN BEGINUpdateReservMgt;REPEAT// Add the following line.ReservEngineMgt.CancelReservation(ReservEntry2);UNTIL ReservEntry2.NEXT = 0;UpdateReservFrom;END;END;...
  13. Change the code in the Controls in the Avail. - Planning Components form (99000900) as follows:Existing code

    ...IF ReservEntry2.FIND('-') THEN BEGINUpdateReservMgt;REPEATIF ReservEntry2."Quantity (Base)" < 0 THENERROR(Text002);// Delete the following line.ReservEngineMgt.CloseReservEntry2(ReservEntry2);UNTIL ReservEntry2.NEXT = 0;UpdateReservFrom;END;END;...

    Replacement code

    ...IF ReservEntry2.FIND('-') THEN BEGINUpdateReservMgt;REPEATIF ReservEntry2."Quantity (Base)" < 0 THENERROR(Text002);// Add the following line.ReservEngineMgt.CancelReservation(ReservEntry2);UNTIL ReservEntry2.NEXT = 0;UpdateReservFrom;END;END;...
  14. Change the code in the CloseReservEntry2 function in the Reservation Engine Mgt. codeunit (99000831) as follows:Existing code 1

    ...LostReservationQty@1019 : Decimal;Text008@1020 : TextConst 'ENU="You cannot state %1 or %2 on a demand when it is linked to a supply by %3 = %4."';ReservationsModified@1021 : Boolean;IsPick@1022 : Boolean;// Delete the following line.PROCEDURE CloseReservEntry2@9(ReservEntry@1002 : Record 337);VARReservEntry3@1003 : Record 337;LastEntryNo@1004 : Integer;BEGINReservEntry.TESTFIELD("Reservation Status",ReservEntry."Reservation Status"::Reservation);...

    Replacement code 1

    ...LostReservationQty@1019 : Decimal;Text008@1020 : TextConst 'ENU="You cannot state %1 or %2 on a demand when it is linked to a supply by %3 = %4."';ReservationsModified@1021 : Boolean;IsPick@1022 : Boolean;// Add the following line.PROCEDURE CancelReservation@9(ReservEntry@1002 : Record 337);VARReservEntry3@1003 : Record 337;LastEntryNo@1004 : Integer;BEGINReservEntry.TESTFIELD("Reservation Status",ReservEntry."Reservation Status"::Reservation);...

    Existing code 2

    ...ReservEntry3.GET(ReservEntry."Entry No.",NOT ReservEntry.Positive);IF (ReservEntry3."Lot No." <> '') OR (ReservEntry3."Serial No." <> '') OR(ReservEntry."Lot No." <> '') OR (ReservEntry."Serial No." <> '') THEN BEGINReservEntry."Reservation Status" := ReservEntry."Reservation Status"::Surplus;// Delete the following lines.ReservEntry3."Reservation Status" := ReservEntry3."Reservation Status"::Surplus;ReservEntry.MODIFY;ReservEntry3.DELETE;ReservEntry3."Entry No." := LastEntryNo + 1;// End of the lines.ReservEntry3.INSERT;TempSurplusEntry.DELETEALL;UpdateTempSurplusEntry(ReservEntry);UpdateTempSurplusEntry(ReservEntry3);UpdateOrderTracking(TempSurplusEntry);...

    Replacement code 2

    ...ReservEntry3.GET(ReservEntry."Entry No.",NOT ReservEntry.Positive);IF (ReservEntry3."Lot No." <> '') OR (ReservEntry3."Serial No." <> '') OR(ReservEntry."Lot No." <> '') OR (ReservEntry."Serial No." <> '') THEN BEGINReservEntry."Reservation Status" := ReservEntry."Reservation Status"::Surplus;// Add the following lines.ReservEntry.Binding := ReservEntry.Binding::" ";ReservEntry3."Reservation Status" := ReservEntry3."Reservation Status"::Surplus;ReservEntry3.Binding := ReservEntry3.Binding::" ";RevertDateToSourceDate(ReservEntry);ReservEntry.MODIFY;ReservEntry3.DELETE;ReservEntry3."Entry No." := LastEntryNo + 1;RevertDateToSourceDate(ReservEntry3);// End of the lines.ReservEntry3.INSERT;TempSurplusEntry.DELETEALL;UpdateTempSurplusEntry(ReservEntry);UpdateTempSurplusEntry(ReservEntry3);UpdateOrderTracking(TempSurplusEntry);...
  15. Change the code in the CloseReservEntry function in the Reservation Engine Mgt. codeunit (99000831) as follows:Existing code

    ...UpdateOrderTracking(TempSurplusEntry);END ELSECloseReservEntry(ReservEntry,TRUE,FALSE);END;// Delete the following lines.PROCEDURE CloseReservEntry@20(ReservEntry@1000 : Record 337;ReTrack@1001 : Boolean;DeleteAll@1002 : Boolean);VARReservEntry2@1003 : Record 337;SurplusReservEntry@1004 : Record 337;DummyReservEntry@1005 : Record 337;TotalQty@1006 : Decimal;AvailabilityDate@1007 : Date;BEGINReservEntry.DELETE;GetItem(ReservEntry."Item No.");IF ReservEntry."Reservation Status" = ReservEntry."Reservation Status"::Prospect THENEXIT;IF ReservEntry."Reservation Status" = ReservEntry."Reservation Status"::Surplus THEN BEGINIF Item."Order Tracking Policy" = Item."Order Tracking Policy"::"Tracking & Action Msg." THENReservMgt.ModifyActionMessage(ReservEntry."Entry No.",0,TRUE); // Delete related action messagesEND ELSE BEGINIF ReservEntry.Binding = ReservEntry.Binding::"Order-to-Order" THENIF Item."Order Tracking Policy" = Item."Order Tracking Policy"::"Tracking & Action Msg." THENReservMgt.ModifyActionMessage(ReservEntry."Entry No.",0,TRUE); // Delete related action messagesReservEntry2.GET(ReservEntry."Entry No.",NOT ReservEntry.Positive);IF (Item."Order Tracking Policy" = Item."Order Tracking Policy"::None) AND(((ReservEntry.Binding = ReservEntry.Binding::"Order-to-Order") AND ReservEntry2.Positive )OR((ReservEntry2."Serial No." = '') AND (ReservEntry2."Lot No." = ''))) THENReservEntry2.DELETEELSE BEGINReservEntry2."Reservation Status" := ReservEntry2."Reservation Status"::Surplus;IF ReservEntry2.Positive THEN BEGINAvailabilityDate := ReservEntry2."Expected Receipt Date";ReservEntry2."Shipment Date" := 0DEND ELSE BEGINAvailabilityDate := ReservEntry2."Shipment Date";ReservEntry2."Expected Receipt Date" := 0D;END;ReservEntry2.MODIFY;ReservEntry2."Quantity (Base)" :=ReservMgt.MatchSurplus(ReservEntry2,SurplusReservEntry,ReservEntry2."Quantity (Base)",NOT ReservEntry2.Positive,AvailabilityDate,Item."Order Tracking Policy");IF ReservEntry2."Quantity (Base)" = 0 THEN BEGINReservEntry2.DELETE(TRUE);END ELSE BEGINReservEntry2.MODIFY;IF Item."Order Tracking Policy" = Item."Order Tracking Policy"::"Tracking & Action Msg." THEN BEGINModifyActionMessageDating(ReservEntry2);IF DeleteAll THENReservMgt.IssueActionMessage(ReservEntry2,FALSE,ReservEntry)ELSEReservMgt.IssueActionMessage(ReservEntry2,FALSE,DummyReservEntry);END;END;END;END;IF ReTrack THEN BEGINTotalQty := ReservMgt.SourceQuantity(ReservEntry,TRUE);ReservMgt.AutoTrack(TotalQty);END;END;PROCEDURE ModifyReservEntry@68(ReservEntry@1000 : Record 337;NewQuantity@1001 : Decimal;NewDescription@1002 : Text[50];ModifyReserved@1003 : Boolean);VARTotalQty@1004 : Decimal;BEGINReservEntry.TESTFIELD("Reservation Status",ReservEntry."Reservation Status"::Reservation);IF NewQuantity * ReservEntry."Quantity (Base)" < 0 THENIF NewQuantity < 0 THENERROR(Text000,ReservEntry.FIELDCAPTION("Quantity (Base)"))ELSEERROR(Text001,ReservEntry.FIELDCAPTION("Quantity (Base)"));IF NewQuantity = 0 THENERROR(Text002);IF ABS(NewQuantity) > ABS(ReservEntry."Quantity (Base)") THENERROR(Text003,ReservEntry.FIELDCAPTION("Quantity (Base)"));IF ModifyReserved THEN BEGINIF ReservEntry."Item No." <> Item."No." THENGetItem(ReservEntry."Item No.");ReservEntry.GET(ReservEntry."Entry No.",ReservEntry.Positive); // Get existing entryReservEntry.VALIDATE("Quantity (Base)",NewQuantity);ReservEntry.Description := NewDescription;ReservEntry."Changed By" := USERID;ReservEntry.MODIFY;IF Item."Order Tracking Policy" > Item."Order Tracking Policy"::None THEN BEGINTotalQty := ReservMgt.SourceQuantity(ReservEntry,TRUE);ReservMgt.AutoTrack(TotalQty);END;IF ReservEntry.GET(ReservEntry."Entry No.",NOT ReservEntry.Positive) THEN BEGIN // Get related entryReservEntry.VALIDATE("Quantity (Base)",-NewQuantity);ReservEntry.Description := NewDescription;ReservEntry."Changed By" := USERID;ReservEntry.MODIFY;IF Item."Order Tracking Policy" > Item."Order Tracking Policy"::None THEN BEGINTotalQty := ReservMgt.SourceQuantity(ReservEntry,TRUE);ReservMgt.AutoTrack(TotalQty);END;// End of the lines.END;END;END;...

    Replacement code

    ...UpdateOrderTracking(TempSurplusEntry);END ELSECloseReservEntry(ReservEntry,TRUE,FALSE);END;// Add the following lines.LOCAL PROCEDURE RevertDateToSourceDate@49(VAR ReservEntry@1000 : Record 337);VARSalesLine@1002 : Record 37;PurchaseLine@1003 : Record 39;TransferLine@1004 : Record 5741;ServiceLine@1005 : Record 5902;ProdOrderLine@1006 : Record 5406;RequisitionLine@1007 : Record 246;ProdOrderComponent@1008 : Record 5407;PlanningComponent@1009 : Record 99000829;JobJournalLine@1010 : Record 210;ItemJournalLine@1011 : Record 83;BOMJournalLine@1012 : Record 89;ItemLedgerEntry@1013 : Record 32;BEGINWITH ReservEntry DO BEGINCASE "Source Type" OFDATABASE::"Sales Line":BEGINSalesLine.GET("Source Subtype","Source ID","Source Ref. No.");IF SalesLine.Quantity < 0 THENChangeDateFieldOnResEntry(ReservEntry,ReservEntry."Expected Receipt Date",TRUE)ELSEChangeDateFieldOnResEntry(ReservEntry,SalesLine."Shipment Date",FALSE);END;DATABASE::"Purchase Line":BEGINPurchaseLine.GET("Source Subtype","Source ID","Source Ref. No.");IF PurchaseLine.Quantity < 0 THENChangeDateFieldOnResEntry(ReservEntry,"Shipment Date",TRUE)ELSEChangeDateFieldOnResEntry(ReservEntry,PurchaseLine."Expected Receipt Date",FALSE);END;DATABASE::"Requisition Line":BEGINRequisitionLine.GET("Source ID","Source Batch Name","Source Ref. No.");ChangeDateFieldOnResEntry(ReservEntry,RequisitionLine."Due Date",FALSE);END;DATABASE::"Planning Component":BEGINPlanningComponent.GET("Source ID","Source Batch Name","Source Prod. Order Line","Source Ref. No.");ChangeDateFieldOnResEntry(ReservEntry,PlanningComponent."Due Date",FALSE);END;DATABASE::"BOM Journal Line":BEGINBOMJournalLine.GET("Source ID","Source Batch Name","Source Ref. No.");ChangeDateFieldOnResEntry(ReservEntry,BOMJournalLine."Posting Date",FALSE);END;DATABASE::"Item Journal Line":BEGINItemJournalLine.GET("Source ID","Source Batch Name","Source Ref. No.");ChangeDateFieldOnResEntry(ReservEntry,ItemJournalLine."Posting Date",FALSE);END;DATABASE::"Job Journal Line":BEGINJobJournalLine.GET("Source ID","Source Batch Name","Source Ref. No.");ChangeDateFieldOnResEntry(ReservEntry,JobJournalLine."Posting Date",FALSE);END;DATABASE::"Item Ledger Entry":BEGINItemLedgerEntry.GET("Source Ref. No.");ChangeDateFieldOnResEntry(ReservEntry,ItemLedgerEntry."Posting Date",FALSE);END;DATABASE::"Prod. Order Line":BEGINProdOrderLine.GET("Source Subtype","Source ID","Source Prod. Order Line");ChangeDateFieldOnResEntry(ReservEntry,ProdOrderLine."Due Date",FALSE);END;DATABASE::"Prod. Order Component":BEGINProdOrderComponent.GET("Source Subtype","Source ID","Source Prod. Order Line","Source Ref. No.");ChangeDateFieldOnResEntry(ReservEntry,ProdOrderComponent."Due Date",FALSE);EXIT;END;DATABASE::"Transfer Line":BEGINTransferLine.GET("Source ID","Source Ref. No.");IF ReservEntry.Positive THENChangeDateFieldOnResEntry(ReservEntry,TransferLine."Receipt Date",FALSE)ELSEChangeDateFieldOnResEntry(ReservEntry,TransferLine."Shipment Date",FALSE);END;DATABASE::"Service Line":BEGINServiceLine.GET("Source Subtype","Source ID","Source Ref. No.");ChangeDateFieldOnResEntry(ReservEntry,ServiceLine."Posting Date",FALSE);END;// End of the lines.END;END;END;...
  16. Change the code in the ChangeDateFieldOnResEntry function in the Reservation Engine Mgt. codeunit (99000831) as follows:Existing code

    ...END;END;END;PROCEDURE CreateForText@70(ReservEntry@1000 : Record 337) : Text[80];BEGINIF ReservEntry.GET(ReservEntry."Entry No.",FALSE) THENEXIT(CreateText(ReservEntry))ELSE...

    Replacement code

    ...END;END;END;// Add the following lines.LOCAL PROCEDURE ChangeDateFieldOnResEntry@50(VAR ReservEntry@1000 : Record 337;NewDate@1002 : Date;Reversal@1003 : Boolean);BEGINIF ReservEntry.Positive XOR Reversal THEN BEGINReservEntry."Expected Receipt Date" := NewDate;ReservEntry."Shipment Date" := 0D;END ELSE BEGINReservEntry."Expected Receipt Date" := 0D;ReservEntry."Shipment Date" := NewDate;END;END;PROCEDURE CloseReservEntry@20(ReservEntry@1000 : Record 337;ReTrack@1001 : Boolean;DeleteAll@1002 : Boolean);VARReservEntry2@1003 : Record 337;SurplusReservEntry@1004 : Record 337;DummyReservEntry@1005 : Record 337;TotalQty@1006 : Decimal;AvailabilityDate@1007 : Date;BEGINReservEntry.DELETE;GetItem(ReservEntry."Item No.");IF ReservEntry."Reservation Status" = ReservEntry."Reservation Status"::Prospect THENEXIT;IF ReservEntry."Reservation Status" = ReservEntry."Reservation Status"::Surplus THEN BEGINIF Item."Order Tracking Policy" = Item."Order Tracking Policy"::"Tracking & Action Msg." THENReservMgt.ModifyActionMessage(ReservEntry."Entry No.",0,TRUE); // Delete related action messagesEND ELSE BEGINIF ReservEntry.Binding = ReservEntry.Binding::"Order-to-Order" THENIF Item."Order Tracking Policy" = Item."Order Tracking Policy"::"Tracking & Action Msg." THENReservMgt.ModifyActionMessage(ReservEntry."Entry No.",0,TRUE); // Delete related action messagesReservEntry2.GET(ReservEntry."Entry No.",NOT ReservEntry.Positive);IF (Item."Order Tracking Policy" = Item."Order Tracking Policy"::None) AND(((ReservEntry.Binding = ReservEntry.Binding::"Order-to-Order") AND ReservEntry2.Positive )OR((ReservEntry2."Serial No." = '') AND (ReservEntry2."Lot No." = ''))) THENReservEntry2.DELETEELSE BEGINReservEntry2."Reservation Status" := ReservEntry2."Reservation Status"::Surplus;IF ReservEntry2.Positive THEN BEGINAvailabilityDate := ReservEntry2."Expected Receipt Date";ReservEntry2."Shipment Date" := 0DEND ELSE BEGINAvailabilityDate := ReservEntry2."Shipment Date";ReservEntry2."Expected Receipt Date" := 0D;END;ReservEntry2.MODIFY;ReservEntry2."Quantity (Base)" :=ReservMgt.MatchSurplus(ReservEntry2,SurplusReservEntry,ReservEntry2."Quantity (Base)",NOT ReservEntry2.Positive,AvailabilityDate,Item."Order Tracking Policy");IF ReservEntry2."Quantity (Base)" = 0 THEN BEGINReservEntry2.DELETE(TRUE);END ELSE BEGINReservEntry2.MODIFY;IF Item."Order Tracking Policy" = Item."Order Tracking Policy"::"Tracking & Action Msg." THEN BEGINModifyActionMessageDating(ReservEntry2);IF DeleteAll THENReservMgt.IssueActionMessage(ReservEntry2,FALSE,ReservEntry)ELSEReservMgt.IssueActionMessage(ReservEntry2,FALSE,DummyReservEntry);END;END;END;END;IF ReTrack THEN BEGINTotalQty := ReservMgt.SourceQuantity(ReservEntry,TRUE);ReservMgt.AutoTrack(TotalQty);END;END;PROCEDURE ModifyReservEntry@68(ReservEntry@1000 : Record 337;NewQuantity@1001 : Decimal;NewDescription@1002 : Text[50];ModifyReserved@1003 : Boolean);VARTotalQty@1004 : Decimal;BEGINReservEntry.TESTFIELD("Reservation Status",ReservEntry."Reservation Status"::Reservation);IF NewQuantity * ReservEntry."Quantity (Base)" < 0 THENIF NewQuantity < 0 THENERROR(Text000,ReservEntry.FIELDCAPTION("Quantity (Base)"))ELSEERROR(Text001,ReservEntry.FIELDCAPTION("Quantity (Base)"));IF NewQuantity = 0 THENERROR(Text002);IF ABS(NewQuantity) > ABS(ReservEntry."Quantity (Base)") THENERROR(Text003,ReservEntry.FIELDCAPTION("Quantity (Base)"));IF ModifyReserved THEN BEGINIF ReservEntry."Item No." <> Item."No." THENGetItem(ReservEntry."Item No.");ReservEntry.GET(ReservEntry."Entry No.",ReservEntry.Positive); // Get existing entryReservEntry.VALIDATE("Quantity (Base)",NewQuantity);ReservEntry.Description := NewDescription;ReservEntry."Changed By" := USERID;ReservEntry.MODIFY;IF Item."Order Tracking Policy" > Item."Order Tracking Policy"::None THEN BEGINTotalQty := ReservMgt.SourceQuantity(ReservEntry,TRUE);ReservMgt.AutoTrack(TotalQty);END;IF ReservEntry.GET(ReservEntry."Entry No.",NOT ReservEntry.Positive) THEN BEGIN // Get related entryReservEntry.VALIDATE("Quantity (Base)",-NewQuantity);ReservEntry.Description := NewDescription;ReservEntry."Changed By" := USERID;ReservEntry.MODIFY;IF Item."Order Tracking Policy" > Item."Order Tracking Policy"::None THEN BEGINTotalQty := ReservMgt.SourceQuantity(ReservEntry,TRUE);ReservMgt.AutoTrack(TotalQty);END;END;END;END;// End of the lines.PROCEDURE CreateForText@70(ReservEntry@1000 : Record 337) : Text[80];BEGINIF ReservEntry.GET(ReservEntry."Entry No.",FALSE) THENEXIT(CreateText(ReservEntry))ELSE...

Prerequisites

You must have one of the following products installed to apply this hotfix:

  • Microsoft Dynamics NAV 2009 R2

  • Microsoft Dynamics NAV 2009 Service Pack 1

Removal information

You cannot remove this hotfix.

Status

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.

Note This is a "FAST PUBLISH" article created directly from within the Microsoft support organization. The information contained herein is provided as-is in response to emerging issues. As a result of the speed in making it available, the materials may include typographical errors and may be revised at any time without notice. See Terms of Use for other considerations.

Need more help?

Want more options?

Explore subscription benefits, browse training courses, learn how to secure your device, and more.