Dynamics AX 2009:将字段添加到 InventJournalTrans,传播到 InventTrans

发布于 2024-10-31 11:18:36 字数 439 浏览 0 评论 0原文

我需要向 InventJournalTrans 添加一个附加字段,该字段在发布后将显示在 InventTrans 表中。该字段是另一个表中记录的引用列。我需要修改哪些方法才能实现此行为?

目前,我已经将字段添加到两个表中,并修改了表单以允许用户输入并保存新字段。我似乎无法找到实际发布到InventTrans发生的兔子洞的底部。

理想情况下,它应该只是在

; 调用之前的 inventTrans.ReasonRefRecId = inventJournalTrans.ReasonRefRecId;

赋值语句

inventTrans.insert()

。有人知道这是在哪里吗?

I need to add an additional field to InventJournalTrans, that after posting will show up in the InventTrans table. The field is a reference column to a record in another table. What method(s) do I need to modify to make this behavior happen?

Currently, I have already added the fields to both tables and modified the Form to allow the user to enter and save the new field. I just can't seem to find the bottom of the rabbit hole on where the actual posting to InventTrans is occurring.

Ideally, it should just be a:

inventTrans.ReasonRefRecId = inventJournalTrans.ReasonRefRecId;

assignment statement before the

inventTrans.insert();

call. Anybody have a clue on where this is at?

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

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

发布评论

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

评论(1

灵芸 2024-11-07 11:18:36

上面的链接确实包含解决方案 - 我已包含该页面中的代码,以防该页面消失或不再可用。感谢 gl00mie 在该网站上的回答并提供了这个答案。

您应该像这样创建一个新的 InventMovement 方法:

public MyNewFieldType myNewField()
{
    return MyNewFieldType::DefaultValue; // suppose your new field is an enum
}

然后修改 \Classes\InventMovement\initInventTransFromBuffer

void initInventTransFromBuffer(InventTrans _inventTrans, InventMovement _movement_orig)
{
    // ... append this line to the end of whatever else is already in this method
    _inventTrans.MyNewField            = this.myNewField();
}

最后重载 InventMov_Journal 类中的新方法:

public MyNewFieldType myNewField()
{
    return inventJournalTrans.MyNewField;
}

The link above does contain the solution -- I have included the code from that page in case that page disappears or no longer becomes available. Thanks to gl00mie for answering on that site and providing this answer.

You should create a new InventMovement method like this:

public MyNewFieldType myNewField()
{
    return MyNewFieldType::DefaultValue; // suppose your new field is an enum
}

Then modify \Classes\InventMovement\initInventTransFromBuffer

void initInventTransFromBuffer(InventTrans _inventTrans, InventMovement _movement_orig)
{
    // ... append this line to the end of whatever else is already in this method
    _inventTrans.MyNewField            = this.myNewField();
}

And finally overload the new method in the InventMov_Journal class:

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