【问题标题】:Error: 'Inventory ID' cannot be found in the system错误:在系统中找不到“库存 ID”
【发布时间】:2017-09-28 10:07:56
【问题描述】:

我正在处理 Acumatica 中的表单,我正在尝试从采购订单中选择 InventoryID,特别是从 POLine。这是我的代码

[PXDBInt()]
[PXUIField(DisplayName = "Inventory ID")]
[PXDefault()]
[PXParent(typeof(Select<InventoryItem, Where<InventoryItem.inventoryID, Equal<Current<POInspectionDetail.inventoryID>>>>))]
[PXSelector(typeof(Search2<POLine.inventoryID,
      LeftJoin<POInspectionDetail, On<POLine.inventoryID, Equal<POInspectionDetail.inventoryID>>>,
        Where<POLine.orderNbr, Equal<Current<POInspection.orderNbr>>,
        And<POLineExt.qControl, Equal<True>>>>),
            typeof(POLine.siteID),
            typeof(POLine.orderQty),
            typeof(POLineExt.qControl))]
public int? InventoryID { get; set; }

public class inventoryID : IBqlField{}

我可以看到像这张图片中的 ID Selector,但如果我选择它,它会显示错误。

你能帮我解决这个问题吗?提前致谢

编辑

protected void POInspectionDetail_RowSelected(PXCache cache, PXRowSelectedEventArgs e)
{
  POInspectionDetail poInspectiondetail = e.Row as POInspectionDetail;



  if(poInspectiondetail.InventoryID != null)
    {
      POLine polines = (POLine)PXSelectorAttribute.Select<POInspectionDetail.inventoryID>(cache, poInspectiondetail);

      poInspectiondetail.WarehouseID = polines.SiteID;
      poInspectiondetail.OpenQty = polines.OrderQty;
      poInspectiondetail.QtyonReceipts = polines.ReceivedQty;
    }      
}

Error

【问题讨论】:

  • 发布代码中的哪一行是第 30 行(如错误指出的那样)?此外,您应该在 RowSelecting 中设置字段 - 而不是选中行。行选择将用于未绑定的字段。 Row Selected 用于 UI 逻辑,例如可见或启用。
  • 这一行,POLine polines = (POLine)PXSelectorAttribute.Select(cache, poInspectiondetail);我尝试使用行选择,但不幸的是它什么也没做
  • 您应该在行选择中调用 cache.setvalueext 而不是像在示例中那样设置行值。 POInspectionDetail dac 是否继承自另一个 DAC?可能与指向 InventoryItem 的 PXParent 冲突。尝试删除该属性,然后重试。
  • 谢谢,我试过缓存,它可以工作。再次感谢

标签: c# acumatica


【解决方案1】:

向用户显示的库存 ID 是 CD 值 - 而不是 int ID 值。

您可能遇到的问题是选择或使用 ID 与 CD 值?

在您的示例中,我将搜索 InventoryItem 并加入您拥有的 2 个表。

然后在你的选择器中添加SubstituteKey = typeof(InventoryItem.InventoryCD), DescriptionField = typeof(InventoryItem.descr)

【讨论】:

  • 我尝试使用它,但我收到此错误,因为我想添加一个包含此字段的事件。事件和错误在问题中更新
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2021-04-20
  • 1970-01-01
  • 2014-10-31
  • 2020-10-08
  • 1970-01-01
相关资源
最近更新 更多