本文对所有国家/地区和语言的所有语言环境的 Microsoft 动态导航。
症状
假设您已经具有多个项跟踪行在 Microsoft Dynamics 导航 2009 年某项作业日志。到 bin 作业日志中过帐物料时,仅更新仓库项跟踪输入的行的最后一项。因此,是项仓库与物料分类帐之间不平衡。
下列产品中发生此问题︰-
Microsoft Dynamics NAV 2009 R2
-
Microsoft Dynamics NAV 2009 Service Pack 1 (SP1)
解决方案
修补程序信息
受支持的修补程序现已从 Microsoft 推出。然而,它仅用于纠正本文中描述的问题。它仅应用于正经历此特定问题的系统。此修补程序可能会接受进一步的测试。因此,如果这个问题没有对您造成严重的影响,我们建议您等待下一步的 Microsoft Dynamics 导航服务包或包含此修复程序的下一个 Microsoft Dynamics 导航版。
注意: 在特殊情况下,可免收的支持电话,可免收如果技术支持专业人员对 Microsoft Dynamics 和相关的产品的费用确定某个特定的更新能够解决您的问题。照常收取支持费用将应用于其他支持问题和对于特定更新无法解决的问题。
安装信息
Microsoft 提供的编程示例仅用于说明,没有任何明示或暗示的担保。这包括但不限于适销性或特定用途适用性的暗示担保。本文假定您熟悉所演示的编程语言和用于创建和调试过程的工具。Microsoft 的支持工程师可以帮助解释某个特定过程的功能,但是他们不会修改这些示例以提供额外的功能或构建过程以满足您的特定要求。
注意:安装此修复程序之前,请验证所有 Microsoft Navision 客户端用户都注销系统。这包括 Microsoft Navision 应用程序服务 (NAS) 客户端的用户。要实现此修补程序时,在登录的唯一客户端用户。 若要实现此修补程序,必须使用开发人员许可证。 我们建议在 Windows 登录窗口或数据库登录窗口中的用户帐户将分配该"超级"角色 id。如果不能将用户帐户分配成"超级"角色 ID,则必须验证用户帐户具有下列权限:-
您将更改该对象的修改权限。
-
为系统对象 ID ™ 5210对象和系统对象 ID 9015对象的 Execute 权限。
注意:您不需要具有对数据存储区的权限,除非您需要执行数据修复。
代码更改
注意:始终测试代码修复在受控环境中应用之前与您的生产计算机的修补程序。
若要解决此问题,请执行以下步骤︰ 创建以下本地变量︰-
作业日志行表 (210) 中添加新的全局变量,然后指定该变量,如下所示︰
-
名称︰ WMSManagement
-
数据类型︰ Codeunit
-
子类型︰ WMS 管理(7302)
-
-
下面的代码在TableRelation属性中的Bin 代码字段 (5403) 作业日志行表 (210) 中删除︰
Bin.Code WHERE (Location Code=FIELD(Location Code));
-
OnValidate触发器 Bin 代码中的代码字段 (5403) 在后续作业日志行表 (210) 中的更改︰
现有代码...// Delete the following lines.
TESTFIELD("Location Code"); CheckItemAvailable; // End of the lines. ...替换代码
...// Add the following lines.
TESTFIELD("Location Code"); IF "Bin Code" <> '' THEN BEGIN GetLocation("Location Code"); Location.TESTFIELD("Bin Mandatory"); END; TESTFIELD(Type,Type::Item); CheckItemAvailable; WMSManagement.FindBinContent("Location Code","Bin Code","No.","Variant Code",'') // End of the lines. ... -
在Bin 代码- OnLookup triggerin (210) 的作业日志行表中添加一个新的本地变量,然后指定该变量,如下所示︰
-
名称︰ BinCode
-
数据类型︰代码
-
长度︰ 20
-
-
在Bin 代码- OnLookup触发器作业日志行表 (210) 中添加以下代码︰
TESTFIELD("Location Code");TESTFIELD(Type,Type::Item);
BinCode := WMSManagement.BinContentLookUp("Location Code","No.","Variant Code",'',"Bin Code"); IF BinCode <> '' THEN VALIDATE("Bin Code",BinCode); -
在仓库日志行表 (7311) 中的源文档字段 (25) 的OptionString属性的值更改为以下︰
OptionString=,s。 顺序、 s。 发票、 s。 贷方通知单、 s。 返回顺序、 第顺序、 第发票、 第贷项通知单、 第返回顺序、 了表 b 中。传输,之后。转移生产。消耗物料 Jnl。,实际完成 Invt。Jnl。,Reclass。Jnl。,消耗 Jnl。,输出 Jnl。,物料清单 Jnl。,Serv 单,作业 Jnl。 -
在仓库日志行表 (7311) 中引用的文档字段 (60) 的OptionString属性的值更改为以下︰
OptionString= 、 Rcpt.,发布第库存过帐、 发布 Rtrn。 Rcpt.,发布第 Cr.备注过帐装运过帐 s。 库存,发布 Rtrn。 装运,过帐 s。 Cr.备注 T.收货,过帐 T.装运过帐项目日记帐,Prod.,传临别,选择,移动,物料清单日志或作业日志 -
仓库的输入表 (7312) 中的源文档字段 (25) 的OptionString属性中的值更改为以下︰
OptionString=,s。 顺序、 s。 发票、 s。 贷方通知单、 s。 返回顺序、 第顺序、 第发票、 第贷项通知单、 第返回顺序、 了表 b 中。传输,之后。转移生产。消耗物料 Jnl。,实际完成 Invt。Jnl。,Reclass。Jnl。,消耗 Jnl。,输出 Jnl。,物料清单 Jnl。,Serv.单,作业 Jnl。 -
仓库的输入表 (7312) 中引用的文档字段 (60) 的OptionString属性中的值更改为以下︰
OptionString= 、 Rcpt.,发布第库存过帐、 发布 Rtrn。 Rcpt.,发布第 Cr.备注过帐装运过帐 s。 库存,发布 Rtrn。 装运,过帐 s。 Cr.备注 T.收货,过帐 T.装运过帐项目日记帐,Prod.,传临别,选择,移动,物料清单日志或作业日志 -
更改位置代码控件 (60) 作业日志窗体 (201) 中的 Visible 属性,如下所示︰
现有代码Visible = Yes
替换代码
Visible = No
-
在作业日志窗体 (201) 中添加位置的代码和工作类型代码字段之间的Bin 代码字段,然后指定字段执行︰
...{ 61 ;Label ;0 ;0 ;0 ;0 ;ParentControl=60;
InColumnHeading=Yes } // Add the following lines. { 102 ;TextBox ;35507;1650 ;1700 ;440 ;ParentControl=1; InColumn=Yes; SourceExpr="Bin Code" } { 103 ;Label ;0 ;0 ;0 ;0 ;ParentControl=102; InColumnHeading=Yes } // End of the lines. { 48 ;TextBox ;11430;2530 ;1650 ;440 ;ParentControl=1; ... -
添加新的全局变量中作业 Jnl。-开机自检线路 codeunit (1012),然后指定该变量,如下所示︰
-
名称︰位置
-
数据类型︰记录
-
子类型︰位置(14)
-
-
在作业 Jnl。 创建一个新的GetLocation函数-开机自检线路 codeunit (1012),如下所示︰
LOCAL PROCEDURE GetLocation@25(LocationCode@1000 : Code[10]);
-
在作业 Jnl。 GetLocation函数中添加以下代码-开机自检线路 codeunit (1012):
IF LocationCode = '' THENCLEAR(Location)
ELSE IF Location.Code <> LocationCode THEN Location.GET(LocationCode); -
在作业 Jnl。 创建一个新的PostWhseJnlLine函数-开机自检线路 codeunit (1012),如下所示︰
LOCAL PROCEDURE PostWhseJnlLine@24(ItemJnlLine@1000 : Record 83;OriginalQuantity@1001 : Decimal;OriginalQuantityBase@1002 : Decimal;VAR TempTrackingSpecification@1003 : TEMPORARY Record 336);
-
在作业 Jnl。 PostWhseJnlLine函数中创建以下本地变量-开机自检线路 codeunit (1012):
-
添加作业 Jnl。 在PostWhseJnlLine函数中的局部变量-开机自检线路 codeunit (1012),然后指定该变量,如下所示︰
-
名称︰ WarehouseJournalLine
-
数据类型︰记录
-
子类型︰仓库日志行(7311)
-
-
添加作业 Jnl。 在PostWhseJnlLine函数中的局部变量-开机自检线路 codeunit (1012),然后指定该变量,如下所示︰
-
名称︰ TempWarehouseJournalLine
-
数据类型︰临时记录
-
子类型︰仓库日志行(7311)
-
-
添加作业 Jnl。 在PostWhseJnlLine函数中的局部变量-开机自检线路 codeunit (1012),然后指定该变量,如下所示︰
-
名称︰ ItemTrackingManagement
-
数据类型︰ Codeunit
-
子类型︰跟踪管理项目(6500)
-
-
添加作业 Jnl。 在PostWhseJnlLine函数中的局部变量-开机自检线路 codeunit (1012),然后指定该变量,如下所示︰
-
名称︰ WMSManagement
-
数据类型︰ Codeunit
-
子类型︰ WMS 管理(7302)
-
-
添加作业 Jnl。 在PostWhseJnlLine函数中的局部变量-开机自检线路 codeunit (1012),然后指定该变量,如下所示︰
-
名称︰ WhseJnlRegisterLine
-
数据类型︰ Codeunit
-
子类型︰ Whse。Jnl。-注册行(7301)
-
-
-
在作业 Jnl。 PostWhseJnlLine函数中添加以下代码-开机自检线路 codeunit (1012),如下所示︰
WITH ItemJnlLine DO BEGINIF "Entry Type" IN ["Entry Type"::Consumption,"Entry Type"::Output] THEN
EXIT; Quantity := OriginalQuantity; "Quantity (Base)" := OriginalQuantityBase; GetLocation("Location Code"); IF Location."Bin Mandatory" THEN IF WMSManagement.CreateWhseJnlLine(ItemJnlLine,0,WarehouseJournalLine,FALSE,FALSE) THEN BEGIN TempTrackingSpecification.MODIFYALL("Source Type",DATABASE::"Job Journal Line"); ItemTrackingManagement.SplitWhseJnlLine(WarehouseJournalLine,TempWarehouseJournalLine,TempTrackingSpecification,FALSE); IF TempWarehouseJournalLine.FIND('-') THEN REPEAT WMSManagement.CheckWhseJnlLine(TempWarehouseJournalLine,1,0,FALSE); WhseJnlRegisterLine.RUN(TempWarehouseJournalLine); UNTIL TempWarehouseJournalLine.NEXT = 0; END; END; -
在作业 Jnl。代码函数中添加新的本地变量-开机自检线路 codeunit (1012),然后指定该变量,如下所示︰
-
名称︰ TempTrackingSpecification
-
数据类型︰临时记录
-
子类型︰跟踪规范(336)
-
-
在作业 Jnl。代码函数中添加新的本地变量-开机自检线路 codeunit (1012),然后指定该变量,如下所示︰
-
名称︰ ItemJnlLine2
-
数据类型︰记录
-
子类型︰物料日记帐行(83)
-
-
更改作业 Jnl。 在代码函数中的代码-开机自检线路 codeunit (1012) 如下︰
现有代码 1...ItemJnlLine.INIT;
ItemJnlLine."Item No." := JobJnlLine2."No."; ...替换代码 1
...ItemJnlLine.INIT;
// Add the following line. ItemJnlLine."Line No." := "Line No."; ItemJnlLine."Item No." := JobJnlLine2."No."; ...现有代码 2
...ItemLedgEntry.LOCKTABLE;
ItemJnlPostLine.RunWithCheck(ItemJnlLine,TempJnlLineDim); END; ...替换代码 2
...ItemLedgEntry.LOCKTABLE;
// Add the following line. ItemJnlLine2 := ItemJnlLine; ItemJnlPostLine.RunWithCheck(ItemJnlLine,TempJnlLineDim); // Add the following lines. ItemJnlPostLine.CollectTrackingSpecification(TempTrackingSpecification); PostWhseJnlLine(ItemJnlLine2,ItemJnlLine2.Quantity,ItemJnlLine2."Quantity (Base)",TempTrackingSpecification); // End of the lines. ... -
在 Whse 中的GetSourceDocument函数中的参考文档参数的OptionString属性的值更改。管理 codeunit (5775) 如下︰
OptionString=,s。 顺序、 s。 发票、 s。 贷方通知单、 s。 返回顺序、 第顺序、 第发票、 第贷项通知单、 第返回顺序、 了表 b 中。传输,之后。转移生产。消耗物料 Jnl。,实际完成 Invt。Jnl。,Reclass。Jnl。,消耗 Jnl。,输出 Jnl。,物料清单 Jnl。,Serv.单,作业 Jnl。 -
在 Whse 中的GetSourceDocument函数中的代码更改。管理 codeunit (5775) 如下︰
现有代码...EXIT;
END; END; ERROR(Text000); ...替换代码
...EXIT;
END; // Add the following lines. DATABASE::"Job Journal Line": BEGIN SourceDocument := SourceDocument::"Job Jnl."; EXIT; END; // End of the lines. END; ERROR(Text000); ... -
更改 WMS 管理 codeunit (7302) 中的CreateWhseJnlLine函数中的代码,请按照如下︰
现有代码...WhseJnlLine."Source Line No." := "Line No.";
END; WhseJnlLine."Source Code" := "Source Code"; WhseJnlLine."Reason Code" := "Reason Code"; WhseJnlLine."Registering No. Series" := "Posting No. Series"; WhseJnlLine."Whse. Document Type" := WhseJnlLine."Whse. Document Type"::" "; // Delete the following line. WhseJnlLine."Reference Document" := WhseJnlLine."Reference Document"::"Item Journal"; WhseJnlLine."Reference No." := "Document No."; ...替换代码
...WhseJnlLine."Source Line No." := "Line No.";
// Add the following lines. END ELSE IF "Job No." <> '' THEN BEGIN WhseJnlLine."Source Type" := DATABASE::"Job Journal Line"; WhseJnlLine."Source Subtype" := ItemJnlTemplateType; WhseMgt.GetSourceDocument(WhseJnlLine."Source Document",WhseJnlLine."Source Type",WhseJnlLine."Source Subtype"); WhseJnlLine."Source No." := "Document No."; WhseJnlLine."Source Line No." := "Line No."; // End of the lines. END;WhseJnlLine."Source Code" := "Source Code"; WhseJnlLine."Reason Code" := "Reason Code"; WhseJnlLine."Registering No. Series" := "Posting No. Series"; WhseJnlLine."Whse. Document Type" := WhseJnlLine."Whse. Document Type"::" "; // Add the following lines. IF "Job No." = '' THEN WhseJnlLine."Reference Document" := WhseJnlLine."Reference Document"::"Item Journal" ELSE WhseJnlLine."Reference Document" := WhseJnlLine."Reference Document"::"Job Journal"; // End of the lines. WhseJnlLine."Reference No." := "Document No."; ...ine."Source Code" := "Source Code"; WhseJnlLine."Reason Code" := "Reason Code"; WhseJnlLine."Registering No. Series" := "Posting No. Series"; WhseJnlLine."Whse. Document Type" := WhseJnlLine."Whse. Document Type"::" "; // Add the following lines. IF "Job No." = '' THEN WhseJnlLine."Reference Document" := WhseJnlLine."Reference Document"::"Item Journal" ELSE WhseJnlLine."Reference Document" := WhseJnlLine."Reference Document"::"Job Journal"; // End of the lines. WhseJnlLine."Reference No." := "Document No."; ...
系统必备组件
您必须具有要应用此修补程序的安装以下产品之一︰
-
Microsoft Dynamics NAV 2009 R2
-
Microsoft Dynamics NAV 2009 Service Pack 1 (SP1)
删除信息
您不能删除此修补程序。
状态
Microsoft 已经确认这是“适用于”一节中列出的 Microsoft 产品中的问题。
注意:这是直接从创建 Microsoft 支持部门内的"快速发布"的文章。此处包含的信息是作为为了响应新出现的问题而提供的。由于以使其可用的速度,而材料可能包含印刷错误,恕不另行通知,随时可能进行修订。其他考虑因素,请参阅使用条款。