I need to add a filter to the Credit Card Processing for Sales screen (SO.50.70.00) so that only records where the DocType = Invoice will show, based on an additional custom checkbox in the filter section called "Invoices Only".
public class SOPaymentProcess_Extension : PXGraphExtension<SOPaymentProcess>
{
protected delegate void AddFiltersDelegate(PXSelectBase<ARPayment> view, SOPaymentProcessFilter filter);
[PXOverride]
protected virtual void AddFilters(PXSelectBase<ARPayment> view, SOPaymentProcessFilter filter, AddFiltersDelegate baseMethod)
{
baseMethod(view, filter);
SOPaymentProcessFilterExt filterExt = PXCache<SOPaymentProcessFilter>.GetExtension<SOPaymentProcessFilterExt>(filter);
if (filterExt.UsrInvoicesOnly != null)
{
// filtering code here
}
}
}
public class SOPaymentProcessFilterExt : PXCacheExtension<PX.Objects.SO.DAC.Unbound.SOPaymentProcessFilter>
{
#region UsrInvoicesOnly
public abstract class usrInvoicesOnly : PX.Data.BQL.BqlString.Field<usrInvoicesOnly> { }
[PXBool]
[PXUIField(DisplayName = "Invoices Only")]
[PXDefault(true)]
public virtual bool? UsrInvoicesOnly { get; set; }
#endregion
}
I've tried overriding the AddFilters() method (see above), but this error is thrown during runtime:
Attempt by method 'Wrapper.PX.Objects.SO.Cst_SOPaymentProcess.AddFiltersGeneratedWrapper(PX.Objects.SO.SOPaymentProcess, PX.Data.PXSelectBase`1, PX.Objects.SO.DAC.Unbound.SOPaymentProcessFilter)' to access method 'PX.Objects.SO.SOPaymentProcess_Extension+AddFiltersDelegate..ctor(System.Object, IntPtr)' failed.
I'm puzzled because the AddFilters() base method is not private. Any suggestions?