2017-06-23 5 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の通常の拡張機能を使用することをお勧めしますエクステンションテーブルを介してDACをリセットします。このアプローチでは、他の投稿に記載されている問題も解決する必要があります。Getting Error : Invalid Column NoteId

関連する問題