Troubleshoot - Violation of Primary Key
1. Error 1 – Violation of Primary Key
1.1 Error Message
When in TASK XchangeFusion, click on the Export Transactions (or Export Event Sales Data), there might be an error message with the header line has “Violation of PRIMARY KEY constraint…”, this is due to the GL entry number is one of the primary keys for GL transactions. The error message may look like this.
1.2 Steps to fix it
- Write down the Org_Code, Fiscal_Year, Fiscal_Period, GL_Source. For example, from the job running above and the error message screen, the Org_Code=50, Fiscal_Year=2019, Fiscal_Period=9, GL_Source=P1.
- Go to the Ungerboeck and select the Organisation, then search for Journal Entries from the main menu. The link also can be retrieved from navigate from Accounting > General Accounting and Analysis > Journal Entries.
- Click on the Journal Entries link and search for the latest Entry Number. Please entry the current Year – Period, Source = “Integration – Point of Sale (P1)”, then click on “Search”. You may need to adjust the layout view by right click on the view.
To adjust the views, right click on any place of the header of the view. Click on “Show Columns” or “Sort, Group and Total”.
First, remove all the tick from “Group on this column”, then Sort By “Entry Number”, with “Descending” direction, click “OK” to update the view.
- Write down the top Entry Number within the view.
- Go back to the main menu and search for “GL Sources”, this link can also be found from Accounting > General Accounting and Analysis > Administration > GL Sources
Click on the “CL Sources” and update the “Last JE #” for the right GL Source.
Now you should be able to run the integration again.