Hello,
I am trying to override the CopyOrderQT function to inject some code after this method runs, however, I can’t seem to figure out what I am doing wrong. Any help would be greatly appreciated.
Original Action:
public virtual IEnumerable CopyOrderQT(PXAdapter adapter)
{
return CopyOrder(adapter);
}
Overridden Action (giving errors):
public delegate void CopyOrderQTDelegate(PXAdapter adapter);
[PXOverride]
public virtual IEnumerable CopyOrderQT(PXAdapter adapter, CopyOrderQTDelegate baseMethod)
{
SOOrder order = Base.DocumentProperties.Current;
SOOrderExt orderExt = order.GetExtension<SOOrderExt>();
orderExt.UsrBlyRecalcUnitPrice = true;
cache.Update(order); //I understand that cache doesn't exist but need to update the order. I need to make a view and then execute based on that.
return adapter.Get(); //I keep getting a wrong return type
}
I am still trying to understand how the delegate works, but ultimately from what I gather, my parameters must match the original action’s and the return must match the original return.
As I mentioned, I want to run the base code and then update a field on the order. Any help or direction would be greatly appreciated.