Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested answer

Number Sequence Saving

(0) ShareShare
ReportReport
Posted on by 454

Hi ,

I have Created one number sequence and assigned to a field. My requirement is when i Press the Save button in the form then only it should be inserted in a table. Otherwise the generated number sequence should not be saved. 

Regards,

Ram

  • Suggested answer
    Ramit Paul Profile Picture
    22,473 Most Valuable Professional on at
    RE: Number Sequence Saving

    Hi Ram,

    I think the continuous option will be fine for this as Nikolaos adviced.

    Curious about which country as I have seen many European countries have this requirement for audit purpose.

  • Suggested answer
    nmaenpaa Profile Picture
    101,158 Moderator on at
    RE: Number Sequence Saving

    The number sequence Next value must be updated when the value is fetched. It can't be updated only when your user saves the record. Otherwise you would get a conflict if two users were creating records in this table at the same time:

    1) User A creates a record and gets nr 1 from the sequence. The record is not yet saved.

    2) User B creates a record and gets nr 1 from the sequence. The record is saved.

    3) User A tries to save, but it fails because there already exists a record with nr 1.

    But, you can set the number sequence to Continuous, then it will reuse the discarded values. This is heavy for performance and should only be activated if there's a legal requirement to have a continuous sequence without gaps.

    Do you have a legal requirement behind this? Or why do you not want to have gaps in the numbers?

  • Ram Kumar Profile Picture
    454 on at
    RE: Number Sequence Saving

    Hi Ramit Paul,

    I have created a new Table named _PPAPHist table. There is one Field called PPAPID. The number sequence should be created for this Field, I have created a new number sequence for that. The generated number sequence should be saved only when i Press save button in the form.Otherwise it should not be saved. For eg: if i entered a new line with generated number seq "1". Only it should be stored when i press save button. If i not pressed Save and closed the form. The number sequence should be start with 1.

    Regards,

    Ram

  • Martin Dráb Profile Picture
    232,850 Most Valuable Professional on at
    RE: Number Sequence Saving

    Isn't it handled by NumberSeqFormHandler automatically?

    If you're not aware of NumberSeqFormHandler, please consult Number Sequence Framework > Using Number Sequences in an Application.

  • Ramit Paul Profile Picture
    22,473 Most Valuable Professional on at
    RE: Number Sequence Saving

    HI Ram,

    Can you give us more info in which field you are adding the num sequence?

    It is hard to share some solution with the above info you shared.

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Jonas ”Jones” Melgaard – Community Spotlight

We are honored to recognize Jonas "Jones" Melgaard as our April 2025…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 293,998 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 232,850 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Product updates

Dynamics 365 release plans