Zero Quantity on Sales Order Line

  • 25 March 2022
  • 1 reply

Is there a way to force a quantity more than 0 on a SO line?

This is more of a quality check for Customer Service during the order entry process.


Best answer by Naveen Boga 26 March 2022, 09:22

View original

1 reply

Userlevel 7
Badge +19

Hi @jrichards ,

We can do below two options.

  1. Provide a validation, when Qty is Zero
  2. Provide default Qty is One



It requires a small piece of customization. Please find the code for reference.

 public class SOOrderEntryEXT : PXGraphExtension<SOOrderEntry>
protected virtual void SOLine_RowPersisting(PXCache sender, PXRowPersistingEventArgs e)
SOLine row = (SOLine)e.Row;
if (row != null)
if (row.OrderQty == decimal.Zero)
sender.RaiseExceptionHandling<SOLine.orderQty>(row, row.OrderQty, new PXSetPropertyException("Quantity must be greater than 0", PXErrorLevel.Error));



  • In OrderQty FieldDefaulting event, you can set the Default Qty as one. Please find the source code below.
    protected virtual void SOLine_OrderQty_FieldDefaulting(PXCache sender, PXFieldDefaultingEventArgs e, PXFieldDefaulting baseEvent)
baseEvent?.Invoke(sender, e);
SOLine row = e.Row as SOLine;
if (row == null) return;

if (row.OrderQty == decimal.Zero)
e.NewValue = row.OrderQty = 1;


Hope this helps!!


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