添加 SOShipline 行选择事件

Add SOShipline row selected event

我正在尝试根据我在 SOShipment 行中作为自定义字段创建的新状态将 ShippedQty 设置为只读。我需要在 SOShipLine_RowSelected 事件中获取 SOShipment 记录,但是 PXSelect 一直给我一个错误。请在下面查看我的代码:

    protected virtual void SOShipLine_RowSelected(PXCache sender, PXRowSelectedEventArgs e)
    {
        SOShipLine soShipLine = (SOShipLine)e.Row;
        if (soShipLine != null)
        {
            SOShipment soShipment = PXSelect<SOShipment,
                        Where<SOShipment.shipmentNbr, Equal<Required<SOShipment.shipmentNbr>>>>.Select(this, soShipLine.ShipmentNbr);
            var soShipmentExt = PXCache<SOShipment>.GetExtension<SOShipmentExt>(soShipment);

            if (soShipment.Status == "N" && soShipmentExt.UsrEDIStatus != "N")
            {
                PXUIFieldAttribute.SetEnabled<SOShipLine.shippedQty>(sender, e.Row, Base.IsImport);
            }
        }

我收到错误:CS0120 非静态字段、方法或 属性 需要对象引用 'PXSelectBase.Select(params object[])'

有人知道为什么吗?这种类型的 select 我用过很多地方。我认为 Select.

中的 soShipLine.ShipmentNbr 参数有问题

函数中的 "this" 变量是 PXGraphExtension 的一个实例,而不是 PXGraph。您可以通过将 "Base"(大写字母 B)传递给 Select 函数来获取图表。

我会警告不要在 RowSelected 事件中进行选择,因为它会显着降低屏幕的性能。在这种情况下,您正尝试从当前装运中获取信息,您也可以从 Base 中检索这些信息(Base.Document.Current 变量)。