web
You’re offline. This is a read only version of the page.
close
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 425

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

I have the same question (0)
  • Ram Prakash Duraisamy Profile Picture
    2,287 on at

    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

  • Himanshu Kamboj Profile Picture
    425 on at

    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? 

  • Suggested answer
    Community Member Profile Picture
    on at

    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

  • Ashish_Pokhriyal Profile Picture
    15 on at

    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
    Sahil Agarwal Profile Picture
    on at

    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.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 108 Super User 2025 Season 2

#2
Jimmy Passeti Profile Picture

Jimmy Passeti 50 Most Valuable Professional

#3
Gerardo Rentería García Profile Picture

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

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans