function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Abhishek Thakur 17Abhishek Thakur 17 

Regarding Formula Field

Hi,

I want to create a formula field that will give output as 22-001. Here 22 is 2022. Now when it goes to the year 2023 I want the output as 23-001. How will I achieve this? I want this field on opportunity object..
AnkaiahAnkaiah (Salesforce Developers) 
Hi Abhishek,

Create a auto number field with specified formatt as you mentioned.

Every year you need to restart the auto number.

After completion of 2022 then chage the data type from auto number to text.

Now the data will be stored in text.

Again change the same field from text to auto number and apply the formatt 23-001 for new records.

Refer the below help article to reset the auto number.
https://help.salesforce.com/s/articleView?id=000325368&type=1

If this helps, Please mark it as best answer.

Thanks!!