Skip to main content

Notifications

Announcements

No record found.

Customer experience | Sales, Customer Insights,...
Answered

Auto-generate numbers for new Opportunity records?

(0) ShareShare
ReportReport
Posted on by 150

Hi All

I hope you're all staying safe and isolated at this pandemic time. 

My client has indicated that they need new Opportunity records to auto-generate unique numbers (like project numbers). They would like it done this way so as to be consistent, avoid duplicity, and have a streamlined way of the system coming up with this field instead of manual input.

Can this be done in D365 Sales?

Many thanks. Tale care 

  • ETconsultant Profile Picture
    ETconsultant 150 on at
    RE: Auto-generate numbers for new Opportunity records?

    Import worked a treat! Thanks.

    (I think export/import has been improved greatly)

  • Verified answer
    LuHao Profile Picture
    LuHao 40,872 on at
    RE: Auto-generate numbers for new Opportunity records?

    Hi ETconsultant,

    Yes, it is by design. The autonumber field does not work on the existing records.

    To Auto Numbering existing records, please refer to

    community.dynamics.com/.../auto-numbering-existing-records-in-microsoft-dynamics-365-crm

    If the number of existing records is not large, you can also export the records as Excel and manually modify and import.

  • ETconsultant Profile Picture
    ETconsultant 150 on at
    RE: Auto-generate numbers for new Opportunity records?

    UPDATE: Managed to find the 'Publish' button in powerapps. I had to go to 'Forms' and then the Publish option was there. Now new opportunity records have the auto field working properly.

    Remaining issue: Existing Opportunity records do not update this auto field even upon re-saving. Is there a solution for this?

  • ETconsultant Profile Picture
    ETconsultant 150 on at
    RE: Auto-generate numbers for new Opportunity records?

    ...Or, what also might be likely is I need to 'publish' this updated field format somehow. But I can't work out how to publish from 'powerapps'.

  • ETconsultant Profile Picture
    ETconsultant 150 on at
    RE: Auto-generate numbers for new Opportunity records?

    Thanks for checking. Interesting.

    Regardless of lock or not, in the app view the auto field is not auto-generated, just left blank. In the web/customize area view on the same form, it does auto-generate.

    I'm trying to see what I've missed but cannot. Might there be a lag in the system that needs some time for the App view to update itself with the auto format of that field?

  • LuHao Profile Picture
    LuHao 40,872 on at
    RE: Auto-generate numbers for new Opportunity records?

    Hi partner,

    I tested in the UCI, and the autonumber field is not locked, but it auto-generates its value.

    pastedimage1585562656237v1.png

    To lock it, just select read-only field in the field properties in the form editor.

    pastedimage1585562749093v2.png

  • ETconsultant Profile Picture
    ETconsultant 150 on at
    RE: Auto-generate numbers for new Opportunity records?

    Hi again Lu Hao

    I have seen that the autonumber format I have created for the field works in the web view (where a lock symbol shows up next to the field on the left).

    But in the app view, there is no lock symbol and the field does not auto-generate.

    Any ideas?

    Thanks for your time.

  • Suggested answer
    LuHao Profile Picture
    LuHao 40,872 on at
    RE: Auto-generate numbers for new Opportunity records?

    Hi partner,

    For existing values, they do not change at all.

    The field of the newly created records will automatically use the auto number attribute you set.

  • ETconsultant Profile Picture
    ETconsultant 150 on at
    RE: Auto-generate numbers for new Opportunity records?

    Thank you very much for this expanded info.

    Do you know, if I make an existing field autonumber, what that will do to existing entries in that field (are they overwritten to blank)?

  • Verified answer
    LuHao Profile Picture
    LuHao 40,872 on at
    RE: Auto-generate numbers for new Opportunity records?

    Hi partner,

    As Pratik said, we can create an OOTB auto-number field for Opportunity entity.

    Whenever a new record is created, its auto-number field automatically generates value. It is locked and we cannot modify it on the form.

    In addition to the link above, let me add some points.

    In the make.powerapps.com, when go to Entities, you need to switch form Default to Managed to find the Opportunity.

    pastedimage1585117541858v1.png

    I would recommend you set the auto-number field to be numbers plus random srtings rather than pure numbers, like {SEQNUM:5}-{RANDSTRING:4}.

    pastedimage1585118241883v2.png

    The advantage is that when the user is using the offline D365, the auto-number field of the newly created record will not duplicate with others. If the auto-number field is numeric, it may be duplicated. If it is numbers plus random strings, it will not be repeated.

    For example, the auto-number field for the latest opportunity is 0100. If a user creates an opportunity record using offline D365, it is 0101.At the same time, another user using online D365 creates an opportunity record, which is also 0101.

    If the auto-number field is numbers plus random strings, these two values will be 0101-qwer and 0101-tyui, they will not be repeated.

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! 🥳

Get Started Blogging in the Community

Hosted or syndicated blogging is available! ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,379 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans