gpt4 book ai didi

axapta - D365FO 中的命令链(方法包装)结果为 'Object is not set to an instance of an object'

转载 作者:行者123 更新时间:2023-12-02 07:03:45 24 4
gpt4 key购买 nike

我正在尝试通过扩展 CustTable 来使用 D365FO 中的新“命令链”功能。

在将值记录到新表中之前,我们需要检查更新方法中的值是否已更改。

[ExtensionOf(tableStr(CustTable))]
final class CustTable_Extension
{
void update(boolean _updateSmmBusRelTable = true, boolean _updateParty =
true)
{
CustTable custTable_Orig = this.orig();
boolean hasChanged = this.CreditMax != custTable_Orig.CreditMax;

next update(_updateSmmBusRelTable, _updateParty);

if(hasChanged)
{
//do something
}
}
}

但是,当运行此代码时,我们收到“对象未设置为对象的实例”错误。发生错误是因为“this”对象为空。调用“next update(_updateSmmBusRelTable, _updateParty);”时我也遇到同样的错误。

documentation状态:“这允许扩展公共(public)和 protected 方法的逻辑,而无需使用事件处理程序。当您包装方法时,您还可以访问该类的其他公共(public)和 protected 方法和变量。”

有什么想法吗?

最佳答案

您必须使用 PU9 或更高版本的 CustTable - Application Suite(重新)编译软件包。

参见https://learn.microsoft.com/en-us/dynamics365/unified-operations/dev-itpro/get-started/whats-new-platform-update-9#supported-versions :

However, this functionality requires the class being augmented to be compiled on Platform update 9. Because the current releases of the Dynamics 365 for Finance and Operations, Enterprise editon applications have been compiled on Platform update 8 or earlier, you will need to recompile a base package (like Application Suite) on Platform update 9 or newer in order to wrap a method that is defined in that package

关于axapta - D365FO 中的命令链(方法包装)结果为 'Object is not set to an instance of an object',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46058172/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com