Microsoft Dynamics AX 2009:执行代码时出错:变量赋值中的参数类型错误

发布于 2024-09-17 08:40:33 字数 615 浏览 8 评论 0原文

我已向 InventMovement 类添加了一个对象成员,并为其创建了一个参数方法,但上面的错误中弹出以下代码行:

movement.parmProdJournalId(this.JournalId);

JournalId parmProdJournalId(JournalId _prodJournalId = prodJournalId)
{
    ;
    prodJournalId =  _prodJournalId;
    return prodJournalId;
}

添加对象成员和参数方法后,我还向前编译了 InventMovement,但没有成功。如果你们中的任何人能在这方面帮助我,我将不胜感激

Rgds

PS:我正在做这篇博文中提到的同样的事情:http://www.artofcreation.be/2009/04/04/wrong-argument-types-in-variable-assignment/

I have added an object member to InventMovement class and have created one parameter method for the same but following line of code is popping up above error:

movement.parmProdJournalId(this.JournalId);

JournalId parmProdJournalId(JournalId _prodJournalId = prodJournalId)
{
    ;
    prodJournalId =  _prodJournalId;
    return prodJournalId;
}

After adding the object member and parameter method I have also compile forward InventMovement but no success. Will appreciate if anyone of you could help me in this regard

Rgds

PS: I am doing the same thing which is mentioned in this blog post: http://www.artofcreation.be/2009/04/04/wrong-argument-types-in-variable-assignment/

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

放手` 2024-09-24 08:40:33

我停止了AOS,重命名了AXAPD.AOI文件并重新启动了AOS em>。这解决了问题。我从其他论坛得到了这个解决方案,我也发布了这个问题。

I stopped the AOS, renamed AXAPD.AOI file and restarted the AOS. This resolved the problem. I got this solution from other forum where also I posted this question.

把时间冻结 2024-09-24 08:40:33

这有点奇怪,应该可以。
我无法重现你的问题,但曾经遇到过类似的问题。通过重新编译和同步每个涉及的类和表(多次)解决了这个问题。
还要确保没有其他人正在使用这些对象中的任何一个,也许最好的方法是重新启动 AOS。

编辑(对问题发表评论后):
另一种可能性:您似乎还混合了 JournalIdProdJournalId
我认为parmProdJournalId的参数和返回值也应该是ProdJournalId
试试这个:

ProdJournalId parmProdJournalId(ProdJournalId _prodJournalId = prodJournalId)
{
    ;
    prodJournalId =  _prodJournalId;
    return prodJournalId;
}

我自己无法尝试,因为我无法重现该错误

It is kind of strange, should work.
I could not reproduce your problem, but once had a similar problem. Solved it by re-compiling and synchronizing every involved class and table (more than once).
Also make sure nobody else is using any of these objects, maybe best is to restart the AOS.

EDIT (after comment on question):
Another possibility: it seams that you are also mixing JournalId and ProdJournalId.
I think the parameter and return value of parmProdJournalId should also be ProdJournalId.
Just try this one:

ProdJournalId parmProdJournalId(ProdJournalId _prodJournalId = prodJournalId)
{
    ;
    prodJournalId =  _prodJournalId;
    return prodJournalId;
}

could not try it myself since I could'nt reproduce the error

溺ぐ爱和你が 2024-09-24 08:40:33

如果无法重新启动AOS,删除客户端本地缓存文件可能会起作用,即*.auc:
C:\Documents and Settings\Local Settings\Application Data

If you can't restart the AOS, delete the local cache files of the client might work, i.e. *.auc from:
C:\Documents and Settings\Local Settings\Application Data

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文