Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested answer

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

(0) ShareShare
ReportReport
Posted on by 399

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

  • Suggested answer
    Sahil Agarwal Profile Picture
    on at
    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
    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
    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
    399 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
    2,287 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

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

Ramesh Kumar – Community Spotlight

We are honored to recognize Ramesh Kumar as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Holly Huffman Profile Picture

Holly Huffman 103

#2
Muhammad Shahzad Shafique Profile Picture

Muhammad Shahzad Sh... 96 Most Valuable Professional

#3
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 51 Most Valuable Professional

Product updates

Dynamics 365 release plans