Skip to main content
Question

How to Restrict Creation/Saving of Sales Order when Customer is already exceeding in Credit Limit

  • March 25, 2026
  • 1 reply
  • 9 views

Forum|alt.badge.img

Hi Acumatica Community,

In Acumatica, when we create a Sales Orders with a customer exceeds in their credit limit. There’s a warning sign.

Once we remove hold, the status will become Credit Hold

With this Set up (Customer Profile and Order Types)

 

Our requirement is to restrict the saving of Sales Orders when the Customer is already exceeding in credit limit.

Is that possible?

Thank you!

 

 

 

 

1 reply

Forum|alt.badge.img+4
  • Jr Varsity II
  • March 25, 2026

Hi ​@Fie ,

  1. Use Workflow Editor Add condition: If Credit Hold = True Disable Save / Confirm / Release
  2. Use below event which will verify Credit limit condition at the time of Sales Order -->Save

protected void SOOrder_RowPersisting(PXCache cache, PXRowPersistingEventArgs e)
{
if (e.Operation != PXDBOperation.Insert && e.Operation != PXDBOperation.Update)
return;

var row = (SOOrder)e.Row;
if (row == null || row.CustomerID == null)
return;

Customer customer = PXSelect<Customer,
Where<Customer.bAccountID, Equal<Required<Customer.bAccountID>>>>
.Select(Base, row.CustomerID);

if (customer != null)
{
decimal creditLimit = customer.CreditLimit ?? 0m;
decimal balance = customer.CuryBalance ?? 0m;

if (balance > creditLimit)
{
throw new PXException("Customer has exceeded the credit limit. Cannot save Sales Order.");
}
}
}

Hope above helps!!