Skip to main content

Notifications

Microsoft Dynamics GP (Archived)

Primary Key Constraint

Posted on by 2

Good day,

In putting through the Reconcile to GL - Inventory, I am getting the attached error message2806.Untitled.jpg 

A check links and reconcile have been done in both Sales and Inventory, the report did not put spit out anything unusual. The Reconcile to GL is only pulling the GL side and not the sub ledger. I am able to put through the job for July successfully. The number, 300559, is an invoice number which is valid, XBA0SV, is also a valid item number.

Not sure what to check again.

Regards

Rosemary

*This post is locked for comments

  • Rosemary Profile Picture
    Rosemary 2 on at
    RE: Primary Key Constraint

    Hi,

    Thanks for your response, I was able to see the table via the dexsql.log. The record in the error message is in the SEE30303 table where the trxsorce is blank , the transaction was done on the 15th of August, I am able to run the reconcile prior to this date and after.

    I restored the database to our test and made a change, updated the record with the dexrowid value  and the reconcile completed with the matched and unmatched records.

    Previously you were seeing only the GL side, I am able to see the subledger as well now.

    Will try this in production now.

    This also appears to be a known issue, I was able to find a couple of blogs on this same error related to the Reconcile to GL option.

    Thanks Mariano, Derek for your input.

    Rosemary

  • RE: Primary Key Constraint

    Hello Rosemary,

    Using the error message you attached previously, the record that is stating as a duplicate is:

    (   , 300559     , 106, 0, 1353, XBA0SV

    The primary key is PK##1850033, which would be for the temporary table named ##1850033.

    If you start a dexsql.log and login to Dynamics GP and re-create this error message, you will see the temp table created, along with the primary key, and dexterity procedures. You could potentially use that to see what information is being populated into the temp table, though the name of it will most likely change each time.

    Dynamics GP uses temp objects, indicated by names that start with # or ##, to do many processes, then either when that process is completed or when the user logs out of Dynamics GP, the temp objects will get dropped. This also occurs when the SQL service is restarted as well, which is why Mariano mentioned to restart the service.

    It may be worth opening a support case with our GP Applications team to look at this more closely, if you haven't already done so.

    Thanks,

  • Rosemary Profile Picture
    Rosemary 2 on at
    RE: Primary Key Constraint

    My apologies for the late response, but, I did as suggested and the same error message.

    Question,  this is the Reconcile to GL and I am doing the Inventory module, the invoice number as I mentioned is valid, it is in the SOP table. You mentioned it is a temp table, exactly what key or record is it trying to insert?

    July reconciliation did not have any issues, I ran July again and there was no issues.

    Rosemary

  • Suggested answer
    Mariano Gomez Profile Picture
    Mariano Gomez 26,225 on at
    RE: Primary Key Constraint

    Rosemary,

    You can restart SQL Server in one of two ways:

    1. From SQL Server Management Studio

    RestartSQLServer2.png

    2. From the Services applet in your Windows Administrative Tools. Right-click and select Restart.

    RestartSQLServer2.png

  • Rosemary Profile Picture
    Rosemary 2 on at
    RE: Primary Key Constraint

    Thank you for your response, when I go to SQL Server Services there are quite a few to choose from, am I just choosing MSSQLSERVER?

    September is our year end and I am being a little cautious.

    Thanks

    Rosemary

  • Mariano Gomez Profile Picture
    Mariano Gomez 26,225 on at
    RE: Primary Key Constraint

    Since this is happening on a temp table, try stopping and restarting the SQL Server service, having all users exit GP first. Try the operation once more.

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