Violation of PRIMARY KEY constraint 'PKAAG20000'. Cannot insert duplicate key in object 'dbo.AAG20000'. The duplicate key value is (18).
The statement has been terminated.
Note:
I've noticed that some field names have changed in AA for GP2010, so you may have to traslate for earlier versions. I'm running GP2010 at this client. Also, the table number in the error message might be different in your case.
AA keeps a 'next record number' of sorts in DYNAMICS..AAG00102. In my case there was an Integration Manager integration that had been running for some time and they were forcing in the AA transactions somehow and the 'next record number' was not getting updated. eConnect tried to do it the right way, and found that the 'next record number' was in use.
To fix: