I need to override this event in ARInvoiceEntry.
protected virtual void _(Events.FieldVerifying<ARTran.curyRetainageAmt> e)
This is the code I have to override the above.
public class ARInvoiceEntry_Extension : PXGraphExtension<ARInvoiceEntry>
{
#region Event Handlers
public delegate void _Delegate(Events.FieldVerifying<ARTran.curyRetainageAmt> e);
[PXOverride]
public void _(Events.FieldVerifying<ARTran.curyRetainageAmt> e, _Delegate baseMethod)
{
baseMethod(e);
}
#endregion
}
However the above is giving me an error:
Invalid argument type in the event handler PX.Objects.AR.ARInvoiceEntry_Extension::_
How would I override an "_" event method?
I have tried this, which then doesn't override the method.
public class ARInvoiceEntry_Extension : PXGraphExtension<ARInvoiceEntry>
{
#region Event Handlers
[PXOverride]
public void _(Events.FieldVerifying<ARTran.curyRetainageAmt> e)
{
// do my stuff
}
#endregion
}
With event handlers, you do not have to do pxoverride. You add a second method with the same signature, and then can call the basemethod parameter.
public void _(Events.FieldVerifying<ARTran.curyRetainageAmt> e, PXFieldVerifying baseMethod)
{
baseMethod?.Invoke(e.Cache, e.Args);
}
the ?.Invoke calls the base function only if it is set, so you do not need to check for nulls.