Skip to main content
Question

catch event "Control Total is required for shipment confirmation."


Forum|alt.badge.img+1

Hi,

Is there any way I catch “ Control Total is required for shipment confirmation. ” exception with my code on shipment screen?

6 replies

Nilkanth Dipak
Semi-Pro II
Forum|alt.badge.img+10

Hi ​@hotdok,

As I understand your question right, You may want to throw an same exception form your code.

You can use 
throw new PXException(Messages.MissingShipmentControlTotal);
 

Hope, it helps!


Forum|alt.badge.img+1
  • Author
  • Varsity I
  • 35 replies
  • March 12, 2025

Hi,

no I mean I want to catch this event with-in my code somehow.


Forum|alt.badge.img+1
  • Author
  • Varsity I
  • 35 replies
  • March 12, 2025

My problem is that ConfirmShipmentAction that Im overriding is executed before acumatica runs Quantity verification code.

 


Forum|alt.badge.img+8
  • Captain II
  • 398 replies
  • March 12, 2025

@hotdok 

 

You could add the code that ​@Nilkanth Dipak shared to your override, which would call it within the ConfirmShipmentAction

 

Aleks


Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • 3417 replies
  • March 17, 2025

@hotdok  Have you tried to pass the value to the Control Qty field same as Shipped Qty? if you are still getting this issue can you please also share your code for our review, if you are comfortable?

 


Forum|alt.badge.img+1
  • Author
  • Varsity I
  • 35 replies
  • March 17, 2025

Thanks for reply. I build the walkarround by explicit calling of ValidateShipment function. This causes Control Quantity checking logic to execute. But this is not exactly what I wanted because this handles only one exception. So this is the code I build

 public delegate IEnumerable ConfirmShipmentActionDelegate(PXAdapter adapter);

 [PXOverride]
 public virtual IEnumerable ConfirmShipmentAction(PXAdapter adapter, ConfirmShipmentActionDelegate handler)
 {
     SOShipment oShip = sh.Select();
     try
     {

         Base.ValidateShipment(oShip);
         IEnumerable res = handler(adapter);
         List<SOShipment> list = adapter.Get<SOShipment>().ToList();

         DoShipmentAction(2, sh.Select());
         Base.Save.Press();
         return res;
     }
     catch (Exception ex)
     {
         throw new PXSetPropertyException(ex.Message);
     }
 }

 


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings