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
NyshaaNyshaa 

How can I dynamically give ID to each record in Lead, Opportunity, Account, etc in salesforce.

I want my each record to have a unique ID 
i.e In format:- ABC001
Can I assign each object of Account, Lead, Opportunity a unique id ?
Devi ChandrikaDevi Chandrika (Salesforce Developers) 
Hi Nyshaa,
You can use auto number field  for this requirement. Create an auto Number field on each object to get unique number for each record.
Auto Number : Automatically assigns a unique number to each record. The maximum length of any auto-number field is 30 characters, 20 of which are reserved for prefix or suffix text. Not available for external objects.

Please refer below link which might help you in this
https://help.salesforce.com/articleView?id=custom_field_types.htm&type=5

Hope this helps you
If this helps kindly mark it as solved so that it may help others in future.

Thanks and Regards