I am trying to insert an invoice via eConnect and some custom code I wrote, but I keep getting the error "Violation of PRIMARY KEY constraint 'PKAAG20000'. Cannot insert duplicate key in object 'dbo.AAG20000'." After doing some research I came across kb 897280, "Error message when you try to post Analytical Accounting transactions in Microsoft Dynamics GP: "Cannot insert duplicate key in object".
This kb says that AAG20000 can be one of the tables as part of the error message. I tried Method 1 (running the sql they provide), but I still get the error. So I thought I would go through Method 2. However I get to step 3:
Type the following query in the query window.select MAX (aaGLHdrID) from aag30000
Select the Company database in the list at the top of the window, and then press F5.
My result from this is NULL. So I am guessing something is very wrong at this point, but I have no clue what this issue is caused from or how to fix it at this point, since I cannot find any more answers on a NULL value for aaGLHdrID in aag30000. Also to note, is that if I try to run select * from aag30000 I get now rows returned. This table is empty. Anyone have an idea how I can fix this without losing all of my data and rebuilding the db from scratch?
Stanley
*This post is locked for comments
I have the same question (0)