Skip to main content

Notifications

Announcements

No record found.

Customer experience | Sales, Customer Insights,...
Suggested answer

How can I prevent duplicate 'Account Numbers'?

Posted on by 25

We have a custom script that creates account numbers on our contact entity. The issue I am running into is that there is nothing to stop a system user (think website account creation) and a user generated account creation from happening at the same time. 

Question 1. Is there a way to force(?)/ implement a datetime that includes seconds on the system level?

Question 2. barring this (q1), would anyone have a mechanism that would allow me to create multiple contacts nearly simultaneously, but not delay the end user experience by artificially delaying their buying process for a minute. 

TIA

  • Suggested answer
    Pradeep Rai Profile Picture
    Pradeep Rai 5,490 Super User 2024 Season 2 on at
  • Suggested answer
    Abdul Wahab Profile Picture
    Abdul Wahab 12,070 Super User 2024 Season 1 on at
    RE: How can I prevent duplicate 'Account Numbers'?

    Hi DFCPSA,

    1. The answer to Question 1#: As per the thread: community.dynamics.com/.../save-seconds-on-datetime-field, No.
    2. The answer to Question 2#: It is difficult to answer. Can you please elaborate on it a little bit more?

    To prevent duplication. You should need to follow these steps:

    1. Create a key for the column in the table. For more details: 
      1. https://learn.microsoft.com/en-us/power-apps/developer/data-platform/define-alternate-keys-entity
      2. https://learn.microsoft.com/en-us/power-apps/maker/data-platform/define-alternate-keys-reference-records
    2. Try to solve your problem with the auto number type column if it is failed then adopt the extension
      1. Use random or sequence numbers at the end of your format. In case of an extension or custom logic. Use a bridge table when the sequence number is your choice to store the previous number or the next number.

  • Suggested answer
    NODAL Profile Picture
    NODAL 860 on at
    RE: How can I prevent duplicate 'Account Numbers'?

    Hi DFCPSA,

    So basically, your auto number field on Account consists of date values and creation of multiple accounts at same time is creating accounts with duplicate numbers.

    You can instead create/convert your auto number field to an Auto number attribute and apply different formats.

    Autonumber: Autonumber columns in Microsoft Dataverse - Power Apps | Microsoft Learn

    Formats: Create auto-number-attributes (Developer Guide for Dynamics 365 Customer Engagement (on-premises)) | Microsoft Learn

    Community Tool Xrmtoolbox:  Auto Number attributes in Microsoft Dynamics 365 ⋆ JonasR.app - the Trenches

    Thanks,

    Ketan

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!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans