Cannot insert duplicate key row in object ....

Problem

Saving a transaction based form errors with 'Cannot insert duplicate key row in object 'xxxxx tablename_fieldname'

Solution

The System Numbers record for the transaction/batch that is being saved needs to be manually updated.  In the screen shot above, the numbering for the Return Supplier Credit Note needs to be incremented by 1

Access to the System Numbers form is required to correct this issue

  1. System Settings > System Numbers
  2. Locate the relevant Setting Description
  3. Increase the relevant line by 1 e.g. increase RACreditNote by 1 from 007 to 008
  4. Save changes
  5. Load, create, complete and save the transaction/batch form that errored e.g. Supplier Return Credits

Sales order numbering

The Setting Description that controls Sales Order numbering is Central