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
rohan patel 30rohan patel 30 

How to generate new numbers in a text field

Hello,
I have requirement of displaying increasing number with each newly created records in contact object in a text filed.

for eg. If i want to create a new contact , one text filed named seriel number should begin from 100(or any particular number) and should continue for further records aslo like 101,102,103, etc.

ps.I can't use auto number. I have to stamp values in text field only.

is there any solution using after trigger or flows.

thanks in advance,
VinayVinay (Salesforce Developers) 
Hi Rohan,

Check below similar examples to generate sequence number using flows or apex trigger.

https://starrdata.com/create-line-item-numbers-salesforce/
https://hicglobalsolutions.com/blog/salesforce-apex-triggers-generate-auto-numbers-records/

Please mark as Best Answer if above information was helpful.

Thanks,
TobyKutlerTobyKutler
Liked Vinay said, use a number field and increment it either using a trigger or Flow each time a contact record is created
Tanya fosilTanya fosil
By default, HTML 5 input field has attribute type=”number” that is used to get input in numeric format. Now forcing input field type=”text” to accept numeric values only by using Javascript or jQuery. You can also set type=”tel” attribute in the input field that will popup numeric keyboard on mobile devices. (https://www.benefitscal.biz/)