我在 CustomField
和 SOOrderDiscountDetail
DAC 中添加了名为 ARInvoiceDiscountDetail
的自定义字段。
public class SOOrderDiscountDetailExt : PXCacheExtension<PX.Objects.SO.SOOrderDiscountDetail>
{
[PXDBString(40)]
[PXUIField(DisplayName="CustomField")]
public virtual string UsrCustomField { get; set; }
public abstract class usrCustomField : PX.Data.BQL.BqlString.Field<usrCustomField> { }
}
public class ARInvoiceDiscountDetailExt : PXCacheExtension<PX.Objects.AR.ARInvoiceDiscountDetail>
{
[PXDBString(40)]
[PXUIField(DisplayName="CustomField")]
public virtual string UsrCustomField { get; set; }
public abstract class usrCustomField : PX.Data.BQL.BqlString.Field<usrCustomField> { }
}
我尝试覆盖 InvoiceOrder
中的 SOInvoiceEntry
方法。
我是否覆盖了正确的方法,如何覆盖原始方法?
答案 0 :(得分:0)
看看 InvoiceCreated 方法是否适合您的情况。
要覆盖的示例如下
public delegate void InvoiceCreatedDelegate(ARInvoice invoice, SOOrder source);
[PXOverride]
public void InvoiceCreated(ARInvoice invoice, SOOrder source, InvoiceCreatedDelegate baseMethod)
{
baseMethod(invoice, source);
if (invoice != null && source != null)
{
ARInvoiceExt invoiceExt = invoice.GetExtension<ARInvoiceExt>();
SOOrderExt orderExt = source.GetExtension<SOOrderExt>();
//your code here ...
}
}
#endregion