Sunday, 26 June 2016

Cannot Insert Duplicate key row in object AAG40000 with unique index 'XXXXXXX'.

Issue :

In my case i have two separate companies.One is live and another one is test.I have restored company data base from live company to test company.In my live company analytical accounting is activated.So when ever i tried to post transaction in test company i had analytical accounting related issues.Below i given the solution for that.

Solution 1:

Restore the dynamics database from live server to test server.
Solution 2:

1. Update the status of AA to '1' (1=installed, but not activated) to start the activation process over. Run this script against the Dynamics database:

Update AAG00104 set aaCompanyStatus = '1' where CMPANYID = 'xx'

(Insert the value of the Company ID from the SY01500 table for the xx placeholder.)


2. Execute these scripts in to clear out all the AA data tables. Run these scripts all at the same time against the company database:

Delete AAG10000

Delete AAG10001

Delete AAG10002

Delete AAG10003

Delete AAG20000

Delete AAG20001

Delete AAG20002

Delete AAG20003

Delete AAG30000

Delete AAG30001

Delete AAG30002

Delete AAG30003

Delete AAG40000

Delete AAG40001

Delete AAG40002

Delete AAG40003

3.Start the activation Process

GO to Tools---Setup--Company--Analytical Accounting--Setup




Select Create Default Record



Select Next

After completing select finish

No comments:

Post a Comment