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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Dynamics 365 Community / Forums / Finance forum / Number sequence not ge...
Finance forum

Number sequence not generating continuously

(0) ShareShare
ReportReport
Posted on by 215

Hi,

I duplicated the DirpartyQuickCreateform and mapped my table in root data source. For that form I created a number sequence and generated. Sometimes, when i create a new record, the number sequence is not generating next ID. It shows previous record and shows duplicate exists in table(root table). 

To fix this issue, I need to change the number sequence of that field to manual and save. And then change back to continuous.

Is there is any other way to fix this issue other than swapping continuous to manual and manual to continuous.

Thanks in advance....

Regards,

Kathiravan M

  • Suggested answer
    André Arnaud de Calavon Profile Picture
    307,784 Super User 2026 Season 2 on at

    Hi Kathiravan,

    You need to check if the numbers which are inserted will be put in the status list of that number sequence. If so, you probably have some coding which tell the number sequence class that a decision will be made later without actually tell the number sequence class that the number has been used. In that case the status list will think the number is still available and then indeed will not give a next number, but will try to re-use one.

    The command "numberSeq.used()" might be missing in your x++ logic.

  • fatihgork Profile Picture
    3,817 on at

    Hi,

    In addition to Andre's post, I wanted to add something.

    @Andre, correct me if I am wrong please.

    Wouldn't pre-allocation of number sequence cause that as well?

    For example if that's the case, preallocation is 10, and there are 3 AOS instances. I assume AOS 1 might have 1 to 10, AOS 2 might have 11 to 20 and so on..

    Then number sequence was set to manual as explained in the first post, and one of the numbers between 1  to 10 was used. In that case  AOS 1 would get an error when it hits that number, since it has been used.

  • André Arnaud de Calavon Profile Picture
    307,784 Super User 2026 Season 2 on at

    Hi Fatih,

    Thanks for your inputs. Pre-allocation is not working together with continuous number sequences. For non-continuous number sequences, if setup, it will reserve and use numbers on each AOS. From your example, it might use the number 11, 21 and 22. Then the AOS 1 might be restarted. In that case AOS 1 will pre allocate e.g. 31 to 40. It will lose the information that 1 till 10 is not used. So, I don't think this pre-allocation will ever generate duplicate numbers.

  • Kathiravan Profile Picture
    215 on at

    Hi André Arnaud de Calavon,

    Thanks for the response.

    I cross checked the number sequence status list. It carries the missing number which only showing me error "already exist".

    I removed the records in status list, now numbers generating correctly.

    Is it possible to skip the missing records, so that it will not create same issue in future.

  • Suggested answer
    nmaenpaa Profile Picture
    101,172 Moderator on at

    Just set the number sequence to non-continuous. Then it will not try to reuse numbers that were previously used, but discarded. Continuous should be used only when it's absolutely necessary to not have gaps in your numbers. For example invoice numbers or voucher numbers might have such requirement in some countries and/or companies.

    But also your x++ code seems to have some issue - it doesn't handle the number sequence calls correctly.

  • Ludwig Reinhard Profile Picture
    Microsoft Employee on at

    Hi Kathiravan,

    I just want to know why you need a continuous number sequence.

    Best regards

    Ludwig

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard > Finance

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans