SBX - Search With Button

SBX - Forum Post Title

econnect error

Microsoft Dynamics GP Forum

mc_line asked a question on 10 Aug 2010 1:35 PM

Question Status

Unanswered

Hi 

 

I am trying to submit an sales order using eConnect and keep getting this error

 

The following error occurred while inserting the transaction :System.Data.SqlClient.SqlException: Violation of PRIMARY KEY constraint 'PKAAG20000'. Cannot insert duplicate key in object 'dbo.AAG20000'. The statement has been terminated. Server stack trace: at Microsoft.Dynamics.GP.eConnect.eConnectMethods.eConnect_EntryPoint(String ConnectionString, ConnectionStringType ConnectionType, String sXML, SchemaValidationType ValidationType, String eConnectSchema) at 

............

 

 

 How do I fix it?

Tthanks

Reply
Rubal responded on 10 Aug 2010 2:27 PM
My Badges

This error means duplicate value with primary key for the table aag20000 (aaSubLedgerHdr). Primary key for this table is aaSubLedgerHdrID. For each new row, value in this column is incremented by 1. For adding a new record, you should use max value in table plus one.

Also, note that table aag00102 in Dynamics database stores next IDs for the Analytical Accounting tables. You will require to update the value in this table for record where aaTableID=20000 and CMPANYID= (your company ID from Table SY01500)

Reply
mc_line responded on 10 Aug 2010 3:03 PM

 Thank you very much. I had kind of figured out this that before.

 

However,  AAG00102 does not contain a table = 2000 for company ID = 10. I am using a debug company that we have here. Is there any reason why this entry would be missing (not installing something) ?

The record is present for the non-debug company. If I had to insert it manually, what would be the DEX_ROW_ID?

 

Thanks.

Reply
mc_line responded on 10 Aug 2010 3:07 PM

 

I meant *table = 20000 (I missed a zero)

Reply
Rubal responded on 10 Aug 2010 3:48 PM
My Badges

The one possible reason for the missing record in table is AAG00102, no transaction is entered/posted from sub ledger with Analytical Accounting codes so far.
You can try manually entering couple of transactions (if you can) in SOP with AA codes to confirm AA is working properly. This should create the record in this table.

You don’t need to insert any value for DEX_ROW_ID (don’t include this field in insert statement). This is an auto-incremented field. SQL will automatically generate value for it.

Reply
Sharath Sakleshpur responded on 7 Sep 2011 9:24 AM

I was getting the same error the solution posted by Rubal "Also, note that table aag00102 in Dynamics database stores next IDs for the Analytical Accounting tables. You will require to update the value in this table for record where aaTableID=20000 and CMPANYID= (your company ID from Table SY01500)" solved my problem. Thanks a lot Rubal.

Reply

SBX - Two Col Forum

SBX - Migrated JS