Hello Community,
I was looking for a way to default the shipment quantity to 0 when creating the “Create Shipment” button on Sales Order or from the Process Orders screen. I thought I could just extend the “CreateShipment” method to accomplish this but not having much luck. See below for the code I have. Is there possibly a setting in Acumatica for this I missed or an issue with the code below?
public delegate void CreateShipmentDelegate(CreateShipmentArgs args);
[PXOverride]
public void CreateShipment(CreateShipmentArgs args, CreateShipmentDelegate baseMethod)
{
// Call the original method to ensure default behavior
baseMethod(args);
Base.Transactions.Current.BaseQty = 0;
Base.Transactions.Current.Qty = 0;
Base.Transactions.Current.ShippedQty = 0;
Base.Transactions.Current.BaseShippedQty = 0;
Base.splits.Current.Qty = 0;
Base.splits.Current.BaseQty = 0;
Base.Transactions.UpdateCurrent();
Base.splits.UpdateCurrent();
}
Thanks,
Adam