Saving a new record reports a duplicate key error

Problem

On rare occasions, saving a new record e.g. sales order, quote, purchase order etc. will report a duplicate key row error on the related table - e.g. "Duplicate key row in object dbo.QO_Main with unique index QO_MainInvoiceNo".

Solution

All numbering for records in the database is controlled by the form System Numbers found in the System Settings menu. The issue is caused by the relevant record in the table SY_Numbers not being updated



  1. System Settings > System Numbers

  2. Locate the relevant record e.g. QuoteNo if the issue is with Quotes

  3. Increase the value by 1

  4. Save the changes

New quotes will now save as expected