Skip to main content
Solved

2025R2 ConfirmShipment action

  • June 17, 2026
  • 3 replies
  • 32 views

Forum|alt.badge.img+2

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

Best answer by Samvel Petrosov

I am not sure why you are trying to override both ConfirmShipmentAction and ConfirmShipment.

It sounds like you need to override ConfirmShipment only.

Your override should be something like and base_ConfirmShipment is the base method you are looking for.

    public delegate IEnumerable ConfirmShipmentDelegate(ConfirmShipmentArgs args);


[PXOverride]
public virtual void ConfirmShipment(ConfirmShipmentArgs args, ConfirmShipmentDelegate base_ConfirmShipment)
{
//Custom logic goes here
base_ConfirmShipment(args);
//More custom logic here if anything should be done after base method call.
}

 

I tried this and it compiled but during runtime I got a big yellow page that said “Expression of type 'System.Void' cannot be used for return type 'System.Collections.IEnumerable'”…

 

That error simply tells that the delegate I wrote as an example is returning a different type than the method being overridden. Here is the corrected override.

    public delegate void ConfirmShipmentDelegate(ConfirmShipmentArgs args);


[PXOverride]
public virtual void ConfirmShipment(ConfirmShipmentArgs args, ConfirmShipmentDelegate base_ConfirmShipment)
{
//Custom logic goes here
base_ConfirmShipment(args);
//More custom logic here if anything should be done after base method call.
}


 

3 replies

Samvel Petrosov
Jr Varsity III
Forum|alt.badge.img+9

I am not sure why you are trying to override both ConfirmShipmentAction and ConfirmShipment.

It sounds like you need to override ConfirmShipment only.

Your override should be something like and base_ConfirmShipment is the base method you are looking for.

    public delegate IEnumerable ConfirmShipmentDelegate(ConfirmShipmentArgs args);


[PXOverride]
public virtual void ConfirmShipment(ConfirmShipmentArgs args, ConfirmShipmentDelegate base_ConfirmShipment)
{
//Custom logic goes here
base_ConfirmShipment(args);
//More custom logic here if anything should be done after base method call.
}

 


Forum|alt.badge.img+2
  • Author
  • Semi-Pro III
  • June 18, 2026

I am not sure why you are trying to override both ConfirmShipmentAction and ConfirmShipment.

It sounds like you need to override ConfirmShipment only.

Your override should be something like and base_ConfirmShipment is the base method you are looking for.

    public delegate IEnumerable ConfirmShipmentDelegate(ConfirmShipmentArgs args);


[PXOverride]
public virtual void ConfirmShipment(ConfirmShipmentArgs args, ConfirmShipmentDelegate base_ConfirmShipment)
{
//Custom logic goes here
base_ConfirmShipment(args);
//More custom logic here if anything should be done after base method call.
}

 

I tried this and it compiled but during runtime I got a big yellow page that said “Expression of type 'System.Void' cannot be used for return type 'System.Collections.IEnumerable'”…

 


Samvel Petrosov
Jr Varsity III
Forum|alt.badge.img+9

I am not sure why you are trying to override both ConfirmShipmentAction and ConfirmShipment.

It sounds like you need to override ConfirmShipment only.

Your override should be something like and base_ConfirmShipment is the base method you are looking for.

    public delegate IEnumerable ConfirmShipmentDelegate(ConfirmShipmentArgs args);


[PXOverride]
public virtual void ConfirmShipment(ConfirmShipmentArgs args, ConfirmShipmentDelegate base_ConfirmShipment)
{
//Custom logic goes here
base_ConfirmShipment(args);
//More custom logic here if anything should be done after base method call.
}

 

I tried this and it compiled but during runtime I got a big yellow page that said “Expression of type 'System.Void' cannot be used for return type 'System.Collections.IEnumerable'”…

 

That error simply tells that the delegate I wrote as an example is returning a different type than the method being overridden. Here is the corrected override.

    public delegate void ConfirmShipmentDelegate(ConfirmShipmentArgs args);


[PXOverride]
public virtual void ConfirmShipment(ConfirmShipmentArgs args, ConfirmShipmentDelegate base_ConfirmShipment)
{
//Custom logic goes here
base_ConfirmShipment(args);
//More custom logic here if anything should be done after base method call.
}