Since the ConfirmShipment() method now has a new signature with ConfirmShipmentArgs replacing all the old parameters, how do I get the Action<SOOrderEntry, SOShipment> baseConfirmShipment? I need to call the base action but I don’t know how to get the PXAdapter or delegate needed to call it.
Here’s what I have so far (the last code line ConfirmShipmentAction() is giving me errors)...
public class PaymentValidationSOShipmentConfirmExt : PXGraphExtension<ConfirmShipmentExtension, SOShipmentEntry>
{
private void ValidateTotalEachSO(SOShipLine soShipLine, bool createShipment)
{...
...}
#region ConfirmShipmentAction
public delegate IEnumerable ConfirmShipmentActionDelegate(PXAdapter adapter);
[PXOverride]
public IEnumerable ConfirmShipmentAction(PXAdapter adapter, ConfirmShipmentActionDelegate baseMethod)
{
// Custom Logic before
var result = baseMethod(adapter);
// Custom Logic after
return result;
}
[PXOverride]
public virtual void ConfirmShipment(ConfirmShipmentArgs args
//SOOrderEntry docgraph,
//SOShipment shiporder,
//Action<SOOrderEntry, SOShipment> baseConfirmShipment
)
{
using (IEnumerator<SOShipLine> enumerator = PXSelectBase<SOShipLine, PXSelect<SOShipLine, Where<SOShipLine.shipmentNbr, Equal<Required<SOShipLine.shipmentNbr>>, And<SOShipLine.shipmentType, Equal<Required<SOShipLine.shipmentType>>>>>.Config>.Select(Base, args.Shipment.ShipmentNbr, args.Shipment.ShipmentType).ToList().Select(a => a.GetItem<SOShipLine>()).GetEnumerator())
{
if (enumerator.MoveNext())
{
ValidateTotalEachSO(enumerator.Current, false);
}
}
//baseConfirmShipment(docgraph, shiporder);
ConfirmShipmentAction();
}
#endregion
