可承諾能力函數計算出最早在週末的出貨,該週若出站 Whse。 處理時間已加入 Microsoft Dynamics NAV

套用到
Dynamics NAV 2009 Microsoft Dynamics NAV 5.0

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

症狀

        
請考慮 Microsoft Dynamics NAV 中的以下情境:

  • 你有一筆銷售訂單使用訂單承諾功能 (能力承諾) 。
  • 客戶有工作週Calendar設定 (週一至週五) 。
  • 一個「出航的 Whse」。 「處理時間」設定會在位置卡上指定。

在此情境中,利用可承諾函數計算最早出貨日期,因為「出站 Whse」的出貨日期。 建議週末採用「處理時間」的設定。 這是錯誤的,因為 Calendar 設定並未被考慮。
此問題發生於以下產品:

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

解決方式

Hotfix 資訊

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

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

            
          

安裝資訊

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

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

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

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

  • 你要更改的物件的修改權限。
  • 系統物件 ID 5210 的執行權限,以及系統物件 ID 9015 的執行權限。

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

法規變更

注意:在將修正程式套用到生產電腦之前,務必在受控環境中測試修正。
如果要解決這個問題,請依照下列步驟執行。

  1. 在 codeunit (99000886) 中 ValidateCapableToPromise 函式中更改程式碼如下:
    在函數中加入以下參數:

    • VAR:是的
    • 名稱:DueDateOfReqLine
    • 資料類型:日期

    加入以下局部變數:

    • 姓名:Ok
    • DataType:布林值

    現有程式碼

    ...
       END;
    // Delete the following line.
    EXIT(CheckDerivedDemandCTP(ReqLine,PeriodType)); 
    // End of the deleted line.
    ...
    

    替換代碼

    ...
      END;
    // Add the following lines.
    Ok := CheckDerivedDemandCTP(ReqLine,PeriodType); 
    IF Ok THEN 
      DueDateOfReqLine := ReqLine."Due Date"; 
    EXIT(Ok); 
    // End of the added lines.
    ...
    
  2. 在 codeunit (99000886) 中更改 CalcCapableToPromise 函式中的程式碼如下:
    加入以下局部變數:

    • 名稱:DueDateOfReqLine
    • 資料類型:日期

    現行法規1

    ...
      IF NOT
       ValidateCapableToPromise(
        ItemNo,VariantCode,LocationCode,CalculationStartDate,
    // Delete the following line.
        NeededQty,UnitOfMeasure,"Order Promising ID",PeriodType) 
    // End of the deleted line. 
    ...
    

    替換代碼1

    ...
       IF NOT
       ValidateCapableToPromise(
        ItemNo,VariantCode,LocationCode,CalculationStartDate,
    
    // Add the following line.
        NeededQty,UnitOfMeasure,"Order Promising ID",PeriodType,DueDateOfReqLine)
    ...
    

    現有的第二號法規

    ...
        RemoveReqLines("Order Promising ID","Source Line No.",OrderPromisingLineToSave,FALSE);
    
    // Delete the following lines.
       IsValid :=         ValidateCapableToPromise(ItemNo,VariantCode,LocationCode,CalculationStartDate, 
         NeededQty,UnitOfMeasure,"Order Promising ID",PeriodType); 
    // End of the deleted lines.   
    ...
    

    替換代碼2

    ...
          RemoveReqLines("Order Promising ID","Source Line No.",OrderPromisingLineToSave,FALSE);
    
    // Add the following lines.
       IsValid := 
        ValidateCapableToPromise(ItemNo,VariantCode,LocationCode,CalculationStartDate, 
         NeededQty,UnitOfMeasure,"Order Promising ID",PeriodType,DueDateOfReqLine); 
    ...
    

    現行法規3

    ...
          ValidateCapableToPromise(ItemNo,VariantCode,LocationCode,CapableToPromiseDate,
    
    // Delete the following line.
        NeededQty,UnitOfMeasure,"Order Promising ID",PeriodType); 
    // End of the deleted line.
    
      END;
      CalculationDialog.CLOSE;
    ...
    

    替代代碼3

    ...
         ValidateCapableToPromise(ItemNo,VariantCode,LocationCode,CapableToPromiseDate,
    
    // Add the following line.
        NeededQty,UnitOfMeasure,"Order Promising ID",PeriodType,DueDateOfReqLine); 
    // End of the added line.
    
       END;
       CalculationDialog.CLOSE; 
    ...
    

    現行代碼4

    ...
       CapableToPromiseDate := CalculationStartDate;
     LastValidLine := GetNextOrderPromisingLineNo; 
    ...
    

    替換代碼4

    ...
        CapableToPromiseDate := CalculationStartDate
    
    // Add the following lines.
    IF CapableToPromiseDate <> DueDateOfReqLine THEN 
      CapableToPromiseDate := DueDateOfReqLine; 
    // End of the added lines.
    
    LastValidLine := GetNextOrderPromisingLineNo; 
    ...
    
  3. 在 codeunit (99000886) 中更改 CheckCompsCapableToPromise 函式中的程式碼如下:
    加入以下局部變數:

    • 名稱:DueDateOfReqLine
    • 資料類型:日期

    現有程式碼

    ...
          ValidateCapableToPromise(
        "Item No.","Variant Code","Location Code","Due Date",
    
    // Delete the following line.
        "Expected Quantity","Unit of Measure Code",OrderPromisingID,PeriodType) 
    ...
    

    替換代碼

    ...
       ValidateCapableToPromise(
        "Item No.","Variant Code","Location Code","Due Date",
    
    // Add the following line.
        "Expected Quantity","Unit of Measure Code",OrderPromisingID,PeriodType,DueDateOfReqLine) 
    ...
    
  4. 在 codeunit (99000886) 中更改 CheckTransferShptCTP 函式中的程式碼如下:
    加入以下局部變數:

    • 名稱:DueDateOfReqLine
    • 資料類型:日期

    現有程式碼

    ...
          ValidateCapableToPromise(
        "No.","Variant Code","Transfer-from Code","Transfer Shipment Date",
    
    // Delete the following line.
         Quantity,"Unit of Measure Code",OrderPromisingID,PeriodType) 
    ...
    

    替換代碼

    ...
        ValidateCapableToPromise(
      "No.","Variant Code","Transfer-from Code","Transfer Shipment Date",
    
    // Add the following line.
       Quantity,"Unit of Measure Code",OrderPromisingID,PeriodType,DueDateOfReqLine)  
    ...
    

          

先決條件

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

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

                
              

移除資訊

你無法移除這個熱修正。

狀態

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

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