Acumatica 添加SOShipline行所选事件

Acumatica 添加SOShipline行所选事件,acumatica,Acumatica,我正在尝试根据我在SoShipping行中作为自定义字段创建的新状态将ShippedQty设置为只读。我需要在SOShipLine_RowSelected事件中获取SoShipping记录,但PXSelect一直给我一个错误。请参阅下面我的代码: protected virtual void SOShipLine_RowSelected(PXCache sender, PXRowSelectedEventArgs e) { SOShipLine soShipLin

我正在尝试根据我在SoShipping行中作为自定义字段创建的新状态将ShippedQty设置为只读。我需要在SOShipLine_RowSelected事件中获取SoShipping记录,但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);
            }
        }
protected virtual void SOShipLine_row选中(PXCache sender,PXRowSelectedEventArgs e)
{
SOShipLine SOShipLine=(SOShipLine)e.Row;
if(soShipLine!=null)
{
SOSHIPATION SOSHIPATION=PXSelect.Select(这是soShipLine.ShipmentNbr);
var soShipmentExt=PXCache.GetExtension(soShipmentExt);
if(soShipmentExt.usredistus!=“N”)
{
PXUIFieldAttribute.SetEnabled(发送方,例如行,基.IsImport);
}
}
我收到错误:CS0120非静态字段、方法或属性“PXSelectBase.Select(params object[])”需要对象引用

有人知道为什么吗?我使用过这种类型的select很多地方。我认为select中的soShipLine.ShipmentNbr参数有问题。

函数中的“this”变量是PXGraphExtension的一个实例,而不是PXGraph。您可以通过将“Base”(大写B)传递给select函数来获得图形


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

我认为我应该能够从缓存中获取装运,但我尝试通过以下方式访问它:SoShipping SoShipping=(SoShipping)e、 行;但在执行时失败。我如何从base访问它。我在添加此ASN模块时进行了大量自定义编码,但没有对现有图形进行大量扩展。感谢您的帮助!另外,我是否需要包括“base.SOShipLine_RowSelected(sender,e);”在扩展的开头?T300文档显示了它,但是我在尝试包含它时遇到了一个错误。错误CS0117'pXgrapherExtension'不包含'SOShipLine_RowSelected'的定义。Row将返回SOShipLine的实例,而不是SoShipping。您可以在Base.Document.Current中找到它。关于第二个问题,这不是一个重写,所以自己调用基类函数没有意义。再次感谢。我按如下方式更改了代码,它工作正常。非常好的帮助。SoShipping SoShipping=base.Document.Search(SoShippline.ShipmentNbr);