【问题标题】:Errors out while saving custom field data into InItemLotSerial table将自定义字段数据保存到 InItemLotSerial 表时出错
【发布时间】:2017-06-27 02:39:38
【问题描述】:

我需要将自定义字段添加到 InItemLotSerial 表。我已向 InItemLotSerial 添加了一个扩展表,以通过自定义页面接受自定义值。

我接受 InventoryItem 中每个序列号的自定义数据

我在 POReceiptEntry 扩展中添加了以下事件,以填充 Inventory Item 中自定义字段的值。

Base.RowInserted.AddHandler<ItemLotSerial>((sender, e) =>
            {
                var serialrow = (ItemLotSerial)e.Row;
                if (serialrow != null)
                {
                    InfoINItemLotSerialExtNV serextrow = PXCache<INItemLotSerial>.GetExtension<InfoINItemLotSerialExtNV>(serialrow);
                    InventoryItem itm = PXSelect<InventoryItem, Where<InventoryItem.inventoryID, Equal<Required<InventoryItem.inventoryID>>>>.Select(Base, serialrow.InventoryID);
                    if (itm != null)
                    {
                        InfoInventoryItemAttributeExtNV extrow = PXCache<InventoryItem>.GetExtension<InfoInventoryItemAttributeExtNV>(itm);
                        if (extrow != null)
                        {
                            serextrow.SearchType = extrow.SearchType;
                            serextrow.DiamondColor = extrow.DiamondColor;
                        }
                    }
                }
            });

在调试时触发事件并将值分配给自定义字段,但在保存购买收据时会引发错误。

`

`

【问题讨论】:

    标签: acumatica


    【解决方案1】:

    ItemLotSerial 装饰有 ItemLotSerialAccumulator 属性,并且完全依赖它来持久化对数据库的更改:

    [ItemLotSerialAccumulator]
    [Serializable]
    public partial class ItemLotSerial : INItemLotSerial, IQtyAllocatedBase
    {
        ...
    }
    

    目前,累加器不支持扩展表,因此您最好的选择可能是在扩展表上使用 INItemLotSerial DAC 的常规扩展。这种方法也应该可以解决您在另一篇帖子Getting Error : Invalid Column NoteId

    中提到的问题

    【讨论】:

      猜你喜欢
      • 2012-11-08
      • 1970-01-01
      • 2021-12-31
      • 2013-04-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多