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
System Settings > System Numbers
Locate the relevant record e.g. QuoteNo if the issue is with Quotes
Increase the value by 1
Save the changes
New quotes will now save as expected