Skip to main content

Notifications

Microsoft Dynamics GP (Archived)

PSTL Chart of Account Change Primary Key Violation PKREC10000

Posted on by 12,931

I am working with a client who is trying to combine several accounts into one using Account Modifier/Combiner in the Professional Services Tools Library (PSTL).   During the combine operation, we receive the following error 'Violation of PRIMARY KEY constraint 'PKREC10000'.  Cannot insert duplicate key in object 'dbo.REC10000'.  The duplicate Key is (3,50).  After querying the REC10000 table, which exists at the company level, I found ACTINDX 3 and 50 matched the index of accounts we were trying to combine several other accounts into.  The original accounts also existed in the REC10000 table, so it appears as though every time one of the accounts is combined into the existing account, PSTL tries to insert another record into this table, violating the primary key. 

My instinct is to remove the original ACTINDX entries - 3 and 50, and all but one of the accounts we want to combine from the REC100000 table.  So PSTL will modify/combine the one remaining account record in this table to the desired final index values (3 and 50) without violating the Primary Key Constraint.

Does anyone have a better suggestion?

*This post is locked for comments

  • Verified answer
    Redbeard Profile Picture
    Redbeard 12,931 on at
    RE: PSTL Chart of Account Change Primary Key Violation PKREC10000

    I was able to test remove the original ACTINDX entries for all but one of the accounts, prior to running the combine process again - IT worked!  It is important to remove the various accounts being merged (changes did not produce the same error).  Example:

    Accts

    1101

    1102

    1103

    Merge 1101, 1102 and 1103 into 1100

    All accounts had previously been assigned to this table for selection as possible cost accounts for transactions entered by custom cost account selection interface.

    When GP converts 1101 to 1100, no problem, but when it combines 1101, 1102 and 1103 into 1100, the result is inserting multiple records with the same value into the REC10000 table.

  • Verified answer
    Heather Roggeveen Profile Picture
    Heather Roggeveen 9,142 on at
    RE: PSTL Chart of Account Change Primary Key Violation PKREC10000

    Hi

    There was a similar issue a couple of weeks back with a different table.  It looks like there may be issues when there is a third party product that might rely on the Account Master information (which is understandable if they have triggers against the Account Master table to add new accounts into their table).

    I agree with Leslie about solution - you probably just need to be sure of what that table does for whichever product it relates to.  Chances are, because you are combing, it is not going to be an issue but there may be processes that rely on that table within the third party product that won't pick up the changes effectively.

    Best way to find out what it relates too would be to look through the resource descriptions for the add-on products that you have.  (Tools --> Resource Descriptions --> Tables).

    Once you have isolated what it relates too, it may be worth raising the issue with the provider of that product so they can maybe include a fix for it in a later release.

    Could be good to add which product it does relate to to this thread so that if others are looking it is a bit less of a needle in a haystack.

    Cheers

    Heather

  • Verified answer
    L Vail Profile Picture
    L Vail 65,271 on at
    RE: PSTL Chart of Account Change Primary Key Violation PKREC10000

    Hi Harry,

    While I am not familiar with the REC10000 table, I've had this problem with a different table using the PSTL tool to combine/change things. My solution is to do exactly what you suggested. I delete the record that was already there so that I can add mine. If you don't want to lose the data (in case you need it later), you can just change it such that the indexes no longer match. I don't know if you need the data for anything. But, the only way to clear a primary key error is to get rid of the matching primary key.

    Kind regards,

    Leslie

  • soma Profile Picture
    soma 24,406 on at
    RE: PSTL Chart of Account Change Primary Key Violation PKREC10000

    Please have a look on the below link.

    blogs.msdn.com/.../violation-of-primary-key-constraint-cannot-insert-duplicate-key-in-object-error-when-using-item-list.aspx

    Hope this helps!!!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,240 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans