Sign in with Microsoft
Sign in or create an account.
Hello,
Select a different account.
You have multiple accounts
Choose the account you want to sign in with.

Symptoms

While releasing an Accounts Receivable invoice batch, the batch suspends with system message 6909. The ardebug will give the following error message:

Violation of PRIMARY KEY constraint 'HistDocSlsTax0'. Cannot insert duplicate key in object 'HistDocSlsTax'.

Cause

There is another invoice in the ardoc table with the same reference number as one of the invoices in this batch. The result is that Solomon is trying to insert a duplicate record in the HistDocSlsTax table.

Workaround

To work around this problem, follow these steps:

  1. Find the duplicated records. To do this, run the following SQL statement:

    select refnbr, doctype, batnbr, * from ardoc tablea 
    where doctype='IN' and refnbr IN
    (select refnbr from ardoc tableb where doctype='IN' and tablea.refnbr=tableb.refnbr
    and tablea.tstamp<>tableb.tstamp and (tablea.batnbr='<XXXXXX>' OR tableb.batnbr='<XXXXXX>'))
    order by refnbr, batnbr

    Note <XXXXXX> is a placeholder for the suspended batch number.

    This script will return the ardoc record of the two (or more) invoices with the same reference number.

  2. Update the invoice in the suspended batch to something slightly different, such as by adding an "A" to the end. Here is an example of the necessary update statements:

    update ardoc set refnbr='01013A' where refnbr='010130' and batnbr='<XXXXXX>'
    update artran set refnbr='01013A' where refnbr='010130' and batnbr='<XXXXXX>'

More Information

When you select a new reference number, make sure that the new reference number has not been already used. Also try to keep the invoice number the same length as the other reference numbers.

Need more help?

Want more options?

Explore subscription benefits, browse training courses, learn how to secure your device, and more.

Communities help you ask and answer questions, give feedback, and hear from experts with rich knowledge.

Was this information helpful?

What affected your experience?
By pressing submit, your feedback will be used to improve Microsoft products and services. Your IT admin will be able to collect this data. Privacy Statement.

Thank you for your feedback!

×