Skip to main content

Notifications

Announcements

No record found.

Dynamics 365 Community / Forums / Sales forum / Want to change the aut...
Sales forum
Suggested answer

Want to change the autogenerated number last digits on the basis of year change

Posted on by 359

Hi,

I have an autogenerated number field (Lease number like:-2021-0001) and it is working fine, as I create the new record then lease number is autogenerate and increasing as per requirement (like:2021-0001, 2021-0002, 2021-0003), but When the year changed the number should be (2022-0001) but the field is generating (2022-0004).

So here I want to change the auto generate number should be reset on the year change and should start from 0001 for new year value, so is there any format in autogenerated field through which I can do this?

leasefilenumber.png

Categories:
  • Suggested answer
    RE: Want to change the autogenerated number last digits on the basis of year change

    Hi,

    As per my knowledge, You need to create a console app and Update AutoNumberFormat of field using update request.

    read in the below doc.

    docs.microsoft.com/.../create-auto-number-attributes

    Please mark as Answer if it is helpful.

  • Ashish_Pokhriyal Profile Picture
    Ashish_Pokhriyal 15 on at
    RE: Want to change the autogenerated number last digits on the basis of year change

    Hi Ju,

    As per your concerns if I create a business rule for adding new values starting from 0001 so when the year 2023 will start then we need to modify the business rule again, I want to do it automatically for every time when the year will be change.

    And if we have to change the logic of business rue for every time when new year will start then it would be better to change the seed value only .

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Want to change the autogenerated number last digits on the basis of year change

    Hi Ram,

    Yes, the seed value will continue with the previous count instead of starting from 1 again though you changed the Prefix.

    Maybe you can create another new autonumber field to store value for new year.

    And hide fields based on create on date through creating business rule:

    Create business rules in Dynamics 365 Customer Engagement (on-premises) | Microsoft Docs

    pastedimage1641454893961v1.png

    Note: you need uncheck 'Visible by default' option for these two automumber fields in the form(Go Settings > Customzations > Entities > select the entity you are using > Forms to open one main form you need).

    pastedimage1641455762899v1.png

    Result:

    pastedimage1641455880184v2.png

    pastedimage1641455898318v3.png

  • Himanshu Kamboj Profile Picture
    Himanshu Kamboj 359 on at
    RE: Want to change the autogenerated number last digits on the basis of year change

    Hi Ram Prakash,

    Thanks for the reply, but I have a little bit confusion here, because it is in my production environment so whenever I will change the seed value It will add the new number only for newly created records.

    It doesn't change the already created record numbers? 

  • Ram Prakash Profile Picture
    Ram Prakash 2,285 on at
    RE: Want to change the autogenerated number last digits on the basis of year change

    Hello Himanshu Kamboj 

    As per my knowledge you need to change the Sequence Number every year by changing Seed Value. There is no Other way, lets wait for other comments too

    Please mark as Answer if it is helpful and provide Kudos


    Subscribe : www.youtube.com/.../UCnGNN3hdlKBOr6PXotskNLA
    Blog : microsoftcrmtechie.blogspot.com

Helpful resources

Quick Links

Dynamics 365 Community Update – Sep 16th

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

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,353 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,251 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans