如何在Acumatica中自动创建记事记录? [英] How to automatically create Note record in Acumatica?

查看:61
本文介绍了如何在Acumatica中自动创建记事记录?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我注意到,每当保存AR发票时,便会在便笺表中创建一条带有新发票便笺ID的记录。你能告诉我这是如何实现的吗?我想让自己的屏幕之一做同样的事情。我想DAC或图形上都必须有某种属性,但我找不到它。我在DAC的NoteID列上具有PXNote属性,但是它不会导致自动创建Note记录。

I've noticed that whenever an AR Invoice gets saved, a record gets created in the Note table with the new invoice's note ID. Can you tell me how that is being accomplished? I'd like to get one of my screens to do the same thing. I guess there must be some kind of attribute on the either the DAC or the graph but I can't find it. I have the PXNote attribute on the NoteID column in my DAC but it does not cause a Note record to be automatically created.

感谢您的帮助。

推荐答案

要在保存新的父记录时自动创建Note记录,应调用静态的 PXNoteAttribute.GetNoteID< Field> ;(PXCache缓存,对象数据)在将父记录插入缓存中时的方法。

To have Note record automatically created when a new parent record gets saved, one should invoke the static PXNoteAttribute.GetNoteID<Field>(PXCache cache, object data) method when the parent record is inserted in the cache.

例如,自动创建Note记录保存新的库存商品时,应为InventoryItem DAC订阅RowInserted处理程序,并调用 PXNoteAttribute.GetNoteID< Field>(...)

For example, to have Note record automatically created when a new Stock Item gets saved, you should subscribe to RowInserted handler for the InventoryItem DAC and call PXNoteAttribute.GetNoteID<Field>(...):

public class InventoryItemMaintExt : PXGraphExtension<InventoryItemMaint>
{
    public void InventoryItem_RowInserted(PXCache sender, PXRowInsertedEventArgs e)
    {
        var noteCache = Base.Caches[typeof(Note)];
        var oldDirty = noteCache.IsDirty;
        PXNoteAttribute.GetNoteID<InventoryItem.noteID>(sender, e.Row);
        noteCache.IsDirty = oldDirty;
    }
}

上面的代码段几乎可以合并到任何自定义中BLC进行了一些简单的更改,即可将InventoryItem替换为自定义DAC。

The code snippet above can be incorporated into almost any custom BLC with a couple simple changes to replace InventoryItem with a custom DAC.

这篇关于如何在Acumatica中自动创建记事记录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆