web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

Duplication Key Error When Using Custom Number Sequence

(0) ShareShare
ReportReport
Posted on by 66
 
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!
I have the same question (0)
  • Verified answer
    Martin Dráb Profile Picture
    240,361 Most Valuable Professional on at
    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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
SajeedMullaji Profile Picture

SajeedMullaji 366

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 289 Super User 2026 Season 2

#3
Martin Dráb Profile Picture

Martin Dráb 260 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans