Solved

Not able to override the ConfirmShipmentAction

  • 16 October 2023
  • 2 replies
  • 60 views

Userlevel 2
Badge

[PXOverride]
        protected virtual IEnumerable ConfirmShipmentAction(PXAdapter adapter)
        {
            this.Base.confirmShipmentAction.Press(adapter);
            return adapter.Get();
        }

 

I have written this code in my Graph extension to override the Base action but I get this error as soon as i click action button on the screen. And after that the shipment is confirmed. 

 

Attempt by method 'Wrapper.PX.Objects.SO.Cst_SOShipmentEntry.ConfirmShipmentActionGeneratedWrapper(PX.Objects.SO.SOShipmentEntry, PX.Data.PXAdapter)' to access method 'MyCust.Acumatica.SOShipmentEntryExt.ConfirmShipmentAction(PX.Data.PXAdapter)' failed.

icon

Best answer by jinin 16 October 2023, 18:43

View original

2 replies

Userlevel 7
Badge +11

Hi @param2022 .

Can you try like below?
 

 public delegate void ConfirmShipmentDelegate(SOOrderEntry docgraph, SOShipment shiporder);
        [PXOverride]
        public virtual void ConfirmShipment(SOOrderEntry docgraph, SOShipment shiporder, ConfirmShipmentDelegate baseMethod)
        {

            //Write the logic
        }

Userlevel 6
Badge +4

Hi @param2022 .

Can you try like below?
 

 public delegate void ConfirmShipmentDelegate(SOOrderEntry docgraph, SOShipment shiporder);
        [PXOverride]
        public virtual void ConfirmShipment(SOOrderEntry docgraph, SOShipment shiporder, ConfirmShipmentDelegate baseMethod)
        {

            //Write the logic
        }

I would add one thing to this.  Remember to call the base method.

#region ConfirmShipment Override
public delegate void confirmShipmentDelegate(SOOrderEntry docgraph, SOShipment shiporder);
[PXOverride]
public virtual void ConfirmShipment(SOOrderEntry docgraph, SOShipment shiporder, confirmShipmentDelegate baseMethod)
{
baseMethod(docgraph, shiporder);
}
#endregion

 

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved