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.
Stanley
*This post is locked for comments