Cannot delete an unposted AR Invoice

Trying to delete an invoice in an AR Invoice Group. The AR Group has a single Invoice that was created with Get Shipments. All lines were deleted, so now just the Header remains.

Upon trying to delete the invoice, I get

With the details showing:

Message: An error occurred while updating the entries. See the inner exception for details.
Inner Exception Message: Violation of PRIMARY KEY constraint ‘PK_TaxSvcMessages’. Cannot insert duplicate key in object ‘Erp.TaxSvcMessages’. The duplicate key value is (MC, I-58260, 0).
The statement has been terminated.
Program: Erp.Adapters.ARInvoice.dll
Method: DeleteMaster

Looks like the line that was originally created had taxes calculated, and now when trying to delete the order, the taxes cannot be cleared/deleted - probably because it is trying to delete the taxes for Invoice Line 0 (which doesn’t exist).

Since it’s a SHIPMENT Invoice, I can’t even add a line to it to give it something to delete.

I’ve also tried various comobs of:

  • TaxConnect enabled/disabled,
  • Ready To calculate
  • changing the “Tax Liability” selection on the header

Any ideas?

Calvin

You tried everything I would have thought to try, might be time to call Epicor support. Let us know what they say. Also - what version of Epicor are you on?

Maybe an updateable BAQ?
I recently cleared a similar problem with a group but… my error referenced a different field than yours.

Are you using Avalara as your TaxConnect software? If so, you might want to check in Avalara to see if you can delete it or disable. The system is indicating there is a duplicate key that already exists on Avalara’s side. This happened to us previously but I’m not sure if it’s related to your issue.

We are using Avalara. I tried disabling Tax Connect, but hadn’t thought about checking the Avalara console to see if info was already transmitted.

Adam -
First off, we’re on 10.1.400.23. And using Avalara Tax Connect

Here’s the response I got from Epicor:

I can’t believe that they would even mention fiddling with the DB at the SQL level. Even with the disclaimer saying they recommend against it. I’ve blocked out the support persons name.

I would never run an UPDATE nor DELETE command against my Epicor SQL database. :wink: That would be reckless. :wink: My users, especially those in sales and finance, are more than happy and welcome the opportunity to wait for days, maybe weeks, for support to go to development, and development to provide a data fix. :wink: :wink:

Interesting note - just had a datafix for a serious issue in LaborDtl table (see Production Labor Rate Is Zero (MES) - ERP 10 - Epicor User Help Forum ) and the data fix provided by support (the first I’ve gotten in quite awhile, and the first on Epicor 10.1) is nothing more than a SQL script with and UDPATE in it.

After several “unofficial” recommendations (three to be exact) by the Epicor Support person, I decided to go half way.

Instead of outright deleting the record in SQL (which there is no “undo”), I decided to UPDATE it, changing the Sequence from 0 to 10 (as this was easy to “undo” should something go wrong)
(the Key indexes are Company, TaxSvcID, and Sequence)

After that change, I was able to delete the Invoice and the AR Group.

1 Like