Resolve order product quantity sync errors
On this page
Symptoms
You see a sync error in the sync error tool with the status code FIELD_INTEGRITY_EXCEPTION and a message similar to one of the following:
- “Can’t save order products with quantities of zero: Quantity”
- “Can’t save order products with negative quantities: Quantity”
The affected object is Order Product (OrderItem).
Cause
Salesforce rejects Order Products with a quantity of zero or a negative quantity unless the matching setting is enabled in Order Settings. Both settings are off by default, so the first order that contains one of these lines fails to sync.
Both kinds of line come from the point of sale:
- Zero quantity: a line cancelled on an open order. Cancelling a line sets its quantity to
0and mirrors that to the linked Order Product, so the cancelled line stays on the order as a record of what was removed rather than disappearing. An order whose lines were all cancelled has every Order Product at quantity0. - Negative quantity: a return or refund line. Returns are written as negative-quantity lines that reduce the order total.
The online store cannot produce either. Zero and negative quantity items are removed from the cart before checkout.
Resolution
Step 1: Enable the relevant setting in Order Settings
- In Salesforce, go to Setup.
- In the Quick Find box, search for Order Settings.
- Open Order Settings.
- Check the setting that matches the error message:
- For “quantities of zero”, check Enable Zero Quantity.
- For “negative quantities”, check Enable Negative Quantity.
- Click Save.
:::note You can turn these settings back off later, but Salesforce then refuses to activate any order that still contains a zero or negative quantity line. Existing records stay visible and editable. Leave the settings on for as long as your registers can cancel lines or process returns. :::
Step 2: Re-sync the failed records
- Go to the sync error tool in StoreConnect.
- Select the checkbox next to all affected Order Product records.
- Click the Re-sync button.
The records should now sync successfully.
:::tip
Select all records in the Sync Errors list when re-syncing, not just the first one. Related downstream errors (such as INVALID_FIELD on order item taxes or payment items) will also clear once the root Order Product records sync.
:::
Verification
- Confirm the sync errors no longer appear in the sync error tool.
- Open the affected order in Salesforce and confirm the Order Products are present with the expected quantities, including any cancelled lines at quantity
0.
Prevention
- Enable both settings before you take POS orders: a register can cancel a line or process a return at any time, so check Enable Zero Quantity and Enable Negative Quantity in Order Settings as part of your initial configuration.
- Check the sync error tool after your first cancellation or return: a rejected Order Product also blocks the order item tax and payment item records behind it, so catching the setting early keeps one order from producing a page of errors.
Was this article helpful?
Thanks for your feedback! It helps us improve our docs.