【发布时间】:2015-06-12 22:58:33
【问题描述】:
我已向 SOSshipment 和 SOSshipmentFilter 添加了一个新的自定义字段。我正在尝试使用它来过滤处理发货的网格,但我遇到了代码问题。我已经在扩展代码的地方进行了其他自定义,但我能够先调用 baseHandler,然后在它返回时执行我的 sn-p。但是,当我覆盖委托函数时,它只是设置了一个返回 baseMethod 的模板。当我将代码放入以包含新的过滤器字段时,我会收到未定义字段/引用的编译错误。我是否需要从原始委托中复制所有原始代码并将其包含在我的覆盖函数中?以下是我当前的覆盖代码:
using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using PX.Data;
using PX.Objects.CS;
using PX.Objects.IN;
using PX.Objects.AR;
using PX.Objects.CM;
using POReceipt = PX.Objects.PO.POReceipt;
using POReceiptLine = PX.Objects.PO.POReceiptLine;
using POLineType = PX.Objects.PO.POLineType;
using PX.Objects;
using PX.Objects.SO;
namespace PX.Objects.SO
{
public class SOInvoiceShipment_Extension:PXGraphExtension<SOInvoiceShipment>
{
#region Event Handlers
public delegate IEnumerable ordersDelegate();
[PXOverride]
public IEnumerable orders(ordersDelegate baseMethod)
{
if (filter.usrTruckNbr != null)
{
((PXSelectBase<SOShipment>)cmd).WhereAnd<Where<SOShipment.usrTruckNbr, GreaterEqual<Current<SOShipmentFilter.usrTruckNbr>>>>();
}
return baseMethod();
}
protected virtual void SOShipmentFilter_UsrTruckNbr_CacheAttached(PXCache cache)
{
}
#endregion
}
}
【问题讨论】:
标签: acumatica