Acumatica 将自定义字段数据保存到InItemLotSerial表时出错
我需要向InItemLotSerial表中添加自定义字段。我向InItemLotSerial添加了一个扩展表,以通过自定义页面接受自定义值 我接受InventoryItem中每个序列号的自定义数据 我在PoreceipEntry扩展中添加了以下事件,以填充库存项中自定义字段的值Acumatica 将自定义字段数据保存到InItemLotSerial表时出错,acumatica,Acumatica,我需要向InItemLotSerial表中添加自定义字段。我向InItemLotSerial添加了一个扩展表,以通过自定义页面接受自定义值 我接受InventoryItem中每个序列号的自定义数据 我在PoreceipEntry扩展中添加了以下事件,以填充库存项中自定义字段的值 Base.RowInserted.AddHandler<ItemLotSerial>((sender, e) => { var serialro
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;
}
}
}
});
调试时会触发事件并将值分配给自定义字段,但在保存采购收据时会引发错误
`
`ItemLotSerial用ItemLotSerialAccumulator属性修饰,并完全依赖它来持久化对数据库的更改:
[ItemLotSerialAccumulator]
[Serializable]
public partial class ItemLotSerial : INItemLotSerial, IQtyAllocatedBase
{
...
}
目前,累加器不支持扩展表,因此最好的选择可能是在扩展表上为INItemLotSerial DAC使用常规扩展。这种方法还应该解决您在其他帖子中提到的问题