「項目追蹤定義為項目[項目編號] 在項目日誌行中,當您嘗試在 Microsoft Dynamics NAV 2009 中為生產訂單發布部分輸出時,會顯示超過您輸入的數量」錯誤訊息

套用到
Dynamics NAV 2009

本文適用於所有國家及語言地區的 Microsoft Dynamics NAV。

症狀

假設你在 Microsoft Dynamics NAV 的製造設定對話框中,所有操作的預設輸出數量值設為。 你定義生產訂單的商品追蹤。 在這種情況下,當你嘗試為生產訂單發布部分輸出時,會收到以下錯誤訊息:

注意

項目日記帳欄中為項目 編號 定義的項目追蹤,會記錄超過您輸入數量的項目。 你必須調整現有的商品追蹤,並重新輸入新數量。

如果你嘗試更正生產訂單的商品追蹤,會收到以下錯誤訊息:

注意

修正無法保存,因為超額量已被定義。 還是關掉表格?

此問題發生於以下產品:

  • Microsoft Dynamics NAV 2009 R2
  • Microsoft Dynamics NAV 2009 服務包 1 (SP1)

      

解決方式

Hotfix 資訊

Microsoft 現在已經支援熱修補程式。 然而,這僅是為了修正本文所描述的問題。 只應用在遇到這個特定問題的系統上。 此熱修補可能會進行額外測試。 因此,如果你沒有受到這個問題嚴重影響,我們建議你等待下一個包含此熱修補的 Microsoft Dynamics NAV 服務包或下一個 Microsoft Dynamics NAV 版本。

注意:在特殊情況下,若 Microsoft Dynamics 及相關產品的技術支援專業人員判斷特定更新能解決您的問題,通常因支援電話而產生的費用可能會被取消。 一般來說,如果有所描述之特定更新無法解決的其他支援問題,才會收取支援費用。

安裝資訊

Microsoft 僅提供圖例的程式設計範例,不含明示或暗示的擔保。 這包括 (但不限於) 適用于特定目的之可操作性或適用性的暗示擔保。 本文假設您熟悉正在示範的程式設計語言,以及用來建立和進行程式偵錯工具的工具。 Microsoft 支援工程師可以協助說明特定程式的功能。 不過,他們將不會修改這些範例以提供新增功能或建構符合您特定需求的程式。

注意:安裝此熱修補程式前,請確認所有 Microsoft Dynamics NAV 用戶端使用者皆已登出系統。 這包括Microsoft Dynamics NAV應用伺服器 (NAS) 服務。 當你實施這個熱修補時,應該只有你一個登入的客戶端使用者。

要實作這個熱修補,你必須擁有開發者授權。

我們建議在 Windows 登入視窗或資料庫登入視窗中,將使用者帳號分配「SUPER」角色 ID。 若使用者帳號無法被指派「SUPER」角色 ID,您必須驗證該帳號擁有以下權限:

  • 你要更改的物件的修改權限。

  • 系統物件 ID 5210 及系統物件 ID 9015 的執行權限

    物件。

注意:除非你必須進行資料修復,否則你不必擁有資料儲存的權利。

法規變更

注意:在將修正程式套用到生產電腦之前,務必在受控環境中測試修正。

如果要解決這個問題,請依照下列步驟執行。

  1. 在預訂管理代碼單元中更改代碼時,請 (99000845) 如下:
    現有程式碼

    ...
    CODE
    ...
    PROCEDURE DeleteReservEntries2@31(DeleteAll@1000 : Boolean;DownToQuantity@1001 : Decimal;VAR ReservEntry@1002 : Record 337);
    ...
    IF QtyToRelease <> 0 THEN BEGIN
    IF ItemTrackingHandling = ItemTrackingHandling::None THEN
    IF DeleteAll THEN
    ERROR(Text010,ReservEntry."Item No.",ReservEntry.TextCaption)
    ELSE
    
    // Delete the following line.
    ERROR(Text008,ReservEntry."Item No.",ReservEntry.TextCaption);
    // End of the deleted line.
    
    ...THEN
    CalcReservedQtyOnPick(TotalAvailQty,QtyAllocInWhse);
    END;
    BEGIN
    END.
    ...
    

    替換代碼

    ...
    CODE
    ...
    PROCEDURE DeleteReservEntries2@31(DeleteAll@1000 : Boolean;DownToQuantity@1001 : Decimal;VAR ReservEntry@1002 : Record 337);
    ...
    IF QtyToRelease <> 0 THEN BEGIN
    IF ItemTrackingHandling = ItemTrackingHandling::None THEN
    IF DeleteAll THEN
    ERROR(Text010,ReservEntry."Item No.",ReservEntry.TextCaption)
    ELSE
    
    // Add the following lines.
    IF NOT ProdJnlLineEntry(ReservEntry) THEN
    ERROR(Text008,ReservEntry."Item No.",ReservEntry.TextCaption);
    // End of the added lines.
    
    ...
    THEN
    CalcReservedQtyOnPick(TotalAvailQty,QtyAllocInWhse);
    END;
    BEGIN
    
    // Add the following lines.
    WITH ReservationEntry DO
    EXIT(("Source Type" = DATABASE::"Item Journal Line") AND ("Source Subtype" = 6));
    END;
    BEGIN
    // End of the added lines.
    
    END.
    ...
    
  2. 請將商品追蹤線表格 (6510) 更改代碼如下:
    現行法規1

    ...
    Text018@1057 : TextConst 'ENU=Saving item tracking line changes';
    ForBinCode@1043 : Code[20];
    Text019@1013 : TextConst 'ENU=There are availability warnings on one or more lines.\Close the form anyway?';
    Text020@1002 : TextConst 'ENU=Placeholder';
    IsPick@1042 : Boolean;
    PROCEDURE SetFormRunMode@19(Mode@1000 : ',Reclass,Combined Ship/Rcpt,Drop Shipment');
    ...
    

    替換代碼1

    ...
    Text018@1057 : TextConst 'ENU=Saving item tracking line changes';
    ForBinCode@1043 : Code[20];
    Text019@1013 : TextConst 'ENU=There are availability warnings on one or more lines.\Close the form anyway?';
    Text020@1002 : TextConst 'ENU=Placeholder';
    IsPick@1042 : Boolean;
    
    // Add the following line.
    ProdOrderLineHandling@2002 : Boolean;
    // End of the added line.
    
    PROCEDURE SetFormRunMode@19(Mode@1000 : ',Reclass,Combined Ship/Rcpt,Drop Shipment');
    ...
    

    現有的第二號法規

    ...
    THEN
    CurrentEntryStatus := CurrentEntryStatus::Surplus
    ELSE
    CurrentEntryStatus := CurrentEntryStatus::Prospect;
    
    // Delete the following lines.
    IF (TrackingSpecification."Source Type" IN
    [DATABASE::"Item Ledger Entry",
    DATABASE::"Item Journal Line",
    DATABASE::"Job Journal Line",
    DATABASE::"BOM Journal Line",
    DATABASE::"Requisition Line"]) OR
    ((TrackingSpecification."Source Type" IN [DATABASE::"Sales Line",DATABASE::"Purchase Line",DATABASE::"Service Line"]) AND
    (TrackingSpecification."Source Subtype" IN [0,2,3]))
    THEN
    SetControls(Controls::Handle,FALSE)
    ELSE
    SetControls(Controls::Handle,TRUE);
    // End of the deleted lines.
    
    SetControls(Controls::Reclass,FormRunMode = FormRunMode::Reclass);
    ...
    

    替換代碼2

    ...
    THEN
    CurrentEntryStatus := CurrentEntryStatus::Surplus
    ELSE
    CurrentEntryStatus := CurrentEntryStatus::Prospect;
    
    // Add the following lines.
    // Set controls for Qty To Handle:
    SetControls(Controls::Handle,GetHandleSource(TrackingSpecification));
    // Set controls for Qty To Invoice:
    SetControls(Controls::Invoice,GetInvoiceSource(TrackingSpecification));
    // End of the added lines.
    
    SetControls(Controls::Reclass,FormRunMode = FormRunMode::Reclass);
    ...
    

    現行法規3

    ...
    SetControls(Controls::Handle,TRUE);
    
    // Delete the following lines.
    IF (TrackingSpecification."Source Type" IN
    [DATABASE::"Item Ledger Entry",
    DATABASE::"Item Journal Line",
    DATABASE::"Job Journal Line",
    DATABASE::"BOM Journal Line",
    DATABASE::"Requisition Line",
    DATABASE::"Transfer Line",
    DATABASE::"Prod. Order Line",
    DATABASE::"Prod. Order Component"]) OR
    ((TrackingSpecification."Source Type" IN [DATABASE::"Sales Line",DATABASE::"Purchase Line",DATABASE::"Service Line"]) AND
    (TrackingSpecification."Source Subtype" IN [0,2,3,4]))
    THEN
    SetControls(Controls::Invoice,FALSE)
    ELSE
    SetControls(Controls::Invoice,TRUE);
    // End of the deleted lines.
    
    SetControls(Controls::Reclass,FormRunMode = FormRunMode::Reclass);
    ...
    

    替代代碼3

    ...
    SetControls(Controls::Handle,TRUE);
    SetControls(Controls::Reclass,FormRunMode = FormRunMode::Reclass);
    ...
    

    現行代碼4

    ...
    BEGIN
    UndefinedQtyArray[1] := SourceQuantityArray[1] - TotalItemTrackingLine."Quantity (Base)";
    UndefinedQtyArray[2] := SourceQuantityArray[2] - TotalItemTrackingLine."Qty. to Handle (Base)";
    UndefinedQtyArray[3] := SourceQuantityArray[3] - TotalItemTrackingLine."Qty. to Invoice (Base)";
    
    // Delete the following lines.
    IF ABS(SourceQuantityArray[1]) < ABS(TotalItemTrackingLine."Quantity (Base)") THEN BEGIN
    ColorOfQuantityArray[1] := 255;
    QtyIsValid := FALSE;
    END ELSE BEGIN
    // End of the deleted lines.
    
    ColorOfQuantityArray[1] := 0;
    
    // Delete the following lines.
    QtyIsValid := TRUE;
    END;
    // End of the deleted lines.
    
    IF ABS(SourceQuantityArray[2]) < ABS(TotalItemTrackingLine."Qty. to Handle (Base)") THEN
    ...
    

    替換代碼4

    ...
    BEGIN
    UndefinedQtyArray[1] := SourceQuantityArray[1] - TotalItemTrackingLine."Quantity (Base)";
    UndefinedQtyArray[2] := SourceQuantityArray[2] - TotalItemTrackingLine."Qty. to Handle (Base)";
    UndefinedQtyArray[3] := SourceQuantityArray[3] - TotalItemTrackingLine."Qty. to Invoice (Base)";
    
    // Add the following lines.
    QtyIsValid :=
    ProdOrderLineHandling OR (ABS(SourceQuantityArray[1]) >= ABS(TotalItemTrackingLine."Quantity (Base)"));
    
    IF ABS(SourceQuantityArray[1]) < ABS(TotalItemTrackingLine."Quantity (Base)") THEN
    ColorOfQuantityArray[1] := 255
    ELSE
    // End of the added lines.
    
    ColorOfQuantityArray[1] := 0;
    IF ABS(SourceQuantityArray[2]) < ABS(TotalItemTrackingLine."Qty. to Handle (Base)") THEN
    ...
    

    現行代碼5

    ...
    CurrForm."Appl.-from Item Entry".VISIBLE(FALSE);
    END;
    BEGIN
    {
    In order to provide F6 invoked lookup from availability bitmap columns, a menu button has been hidden behind control 1.
    ...
    

    替換代碼5

    ...
    CurrForm."Appl.-from Item Entry".VISIBLE(FALSE);
    END;
    
    // Add the following lines.
    PROCEDURE GetHandleSource@63(TrackingSpecification@2004 : Record 336) : Boolean;
    VAR
    QtyToHandleColumnIsHidden@2005 : Boolean;
    // End of the added lines.
    
    BEGIN
    
    // Add the following lines.
    WITH TrackingSpecification DO BEGIN
    IF ("Source Type" = DATABASE::"Item Journal Line") AND ("Source Subtype" = 6) THEN BEGIN // 6 => Prod.order line
    ProdOrderLineHandling := TRUE;
    EXIT(TRUE); // Display Handle column for prod. orders
    END;
    QtyToHandleColumnIsHidden :=
    ("Source Type" IN
    [DATABASE::"Item Ledger Entry",
    DATABASE::"Item Journal Line",
    DATABASE::"Job Journal Line",
    DATABASE::"Requisition Line"]) OR
    (("Source Type" IN [DATABASE::"Sales Line",DATABASE::"Purchase Line",DATABASE::"Service Line"]) AND
    ("Source Subtype" IN [0,2,3]));
    END;
    EXIT(NOT QtyToHandleColumnIsHidden);
    END;
    
    PROCEDURE GetInvoiceSource@73(TrackingSpecification@2007 : Record 336) : Boolean;
    VAR
    QtyToInvoiceColumnIsHidden@2009 : Boolean;
    BEGIN
    WITH TrackingSpecification DO BEGIN
    QtyToInvoiceColumnIsHidden :=
    ("Source Type" IN
    [DATABASE::"Item Ledger Entry",
    DATABASE::"Item Journal Line",
    DATABASE::"Job Journal Line",
    DATABASE::"Requisition Line",
    DATABASE::"Transfer Line",
    DATABASE::"Prod. Order Line",
    DATABASE::"Prod. Order Component"]) OR
    (("Source Type" IN [DATABASE::"Sales Line",DATABASE::"Purchase Line",DATABASE::"Service Line"]) AND
    ("Source Subtype" IN [0,2,3,4]))
    END;
    EXIT(NOT QtyToInvoiceColumnIsHidden);
    END;
    
    BEGIN
    // End of the added lines.
    
    {
    In order to provide F6 invoked lookup from availability bitmap columns, a menu button has been hidden behind control 1.
    ...
    

          

先決條件

您必須安裝以下其中一項產品才能套用此熱修補:

  • Microsoft Dynamics NAV 2009 R2
  • Microsoft Dynamics NAV 2009 Service Pack 1

移除資訊

你無法移除這個熱修正。

狀態

Microsoft 已確認這是「適用對象」一節中列出的 Microsoft 產品中的問題。

注意本文為 Microsoft 支援單位內部直接建立的「快速發佈」文章。 此處包含的資訊是以其現況提供,用於回應新產生的問題。 由於快速發佈,資料可能包含拼字錯誤,並可能會隨時修訂,不另行通知。 請參閱使用條款以瞭解其他相關考量。