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
Divyansh Verma 10Divyansh Verma 10 

auto_number trigger

Write a trigger to make an autonumber field on Account with the format "ACC-001".This field will increment sequentially as (ACC-002, ACC-003, .....) everytime when a new account is inserted.

Thanks.
VinayVinay (Salesforce Developers) 
Hi Divyansh,

You can create new custom field with data type as auto number and it should generate incremental values sequentially.

Review below link which has a working example if you want to use trigger.

https://developer.salesforce.com/forums/?id=9060G0000005QoIQAU

Hope above information was helpful.

Please mark as Best Answer so that it can help others in the future.

Thanks,
Vinay Kumar