Microsoft Dynamics AX 2009:执行代码时出错:变量赋值中的参数类型错误
我已向 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我停止了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.
这有点奇怪,应该可以。
我无法重现你的问题,但曾经遇到过类似的问题。通过重新编译和同步每个涉及的类和表(多次)解决了这个问题。
还要确保没有其他人正在使用这些对象中的任何一个,也许最好的方法是重新启动 AOS。
编辑(对问题发表评论后):
另一种可能性:您似乎还混合了
JournalId
和ProdJournalId
。我认为
parmProdJournalId
的参数和返回值也应该是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
andProdJournalId
.I think the parameter and return value of
parmProdJournalId
should also beProdJournalId
.Just try this one:
could not try it myself since I could'nt reproduce the error
如果无法重新启动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