2017-06-23 54 views
0

我需要將自定義字段添加到InItemLotSerial表中。我已經爲InItemLotSerial添加了一個擴展表來通過自定義頁面接受自定義值。將自定義字段數據保存到InItemLotSerial表中時出錯

我接受自定義數據爲每個序列號在InventoryItem enter image description here

我已經添加在POReceiptEntry擴展以下事件從庫存項目填寫的自定義字段的值。

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; 
         } 
        } 
       } 
      }); 

在調試事件時觸發並將值分配給自定義字段,但在保存購買收據時引發錯誤。

enter image description here

`

`

回答

1

ItemLotSerial裝飾與ItemLotSerialAccumulator屬性,並在更改保存到數據庫方面完全依賴於它:

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

目前,蓄電池不支持擴展表,所以你最好的選擇可能是使用INItemLotS的常規擴展erial DAC通過擴展表。此方法還應解決您在其他帖子中提到的問題Getting Error : Invalid Column NoteId

相關問題