Skip to main content

Notifications

Announcements

No record found.

Finance | Project Operations, Human Resources, ...
Answered

Duplication Key Error When Using Custom Number Sequence

(0) ShareShare
ReportReport
Posted on by 58
 
Hey D365FO community!
I hope you're all doing well. I'm currently working on a project in D365FO as a developer, and I've hit a roadblock that I could use some assistance with. Here's a breakdown of the issue:
**The Problem:**
I created a custom number sequence and linked it as an index for a new table. Initially, everything seemed to be working fine. However, I'm now encountering a duplication key error that I can't seem to resolve.
 
**What I've Tried So Far:**
I've attempted to delete all records associated with this number sequence and even created a new one from scratch, but the error persists.
I delete the key and it didntt solve the prblm
It seems like there's an underlying issue that I haven't been able to identify.
 
**Additional Information:**
To provide more context, here are some additional details:
- I make sure that no other insert or doinsert call are done before

 
 
I'm open to any suggestions or insights you may have. Thanks in advance for your help!
  • Verified answer
    Martin Dráb Profile Picture
    Martin Dráb 230,569 Most Valuable Professional on at
    Duplication Key Error When Using Custom Number Sequence
    I suggest the following:
     
    1. Stop in debugger in insert().
    2. Open SSMS and check out if the value already exists in database. If so, it means that you number sequence conflicts with existing data.
    3. If you don't see it in committed data, try uncommitted (e.g. by WITH (NOLOCK)). If so, it seems that the same value is inserted twice in the same transaction.
    4. If nothing is there, you probably have a problem with a different unique index. The error message mentions a field from the primary index, but the actually conflicting index may be different.

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

Congratulations 2024 Spotlight Honorees

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December

Congratulations to our December super stars! 🥳

Start Your Super User Journey Pt 2

Join the ranks of our community heros! 🦹

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,569 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans