Take the 2-minute tour ×
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It's 100% free, no registration required.

I know that if you create a custom object, with an Auto-number Name field with a format, e.g. MYC-{0000} you will be able to create records from MYC-0000 to MYC-9999.

The moment you create 10,000 records Salesforce happily extends the range and you can then create MYC-10000 to MYC-99999.

My question is, what is the limit to this - for obvious reasons its a difficult one to test. I know instances that have exceeded 999,999 e.g. MYC-1000000 but am interested to know how far this extends to.

EDIT: When the field has a data type of Text the maximum length is 80. Is it safe to assume that the same is true for Autonumber (though that would be a very big number)?

share|improve this question

1 Answer 1

up vote 9 down vote accepted

The maximum length of an Auto Number field is 30 characters, 10 of which can be the number and 20 of which can be the prefix.

Your starting number must be less than 1,000,000,000, which means that the most that you can start it out at is 999,999,999. That means that in the worst configuration you could make you'd still be able to create ~9 billion records (9,999,999,999 - 999,999,999) before you'd reach the maximum allowed. I don't know what happens when it hits 11 digits, although if the docs state the max is 10 digits then I'd expect an error.

Check out the doc page on custom field attributes, specifically the Staring Number entry.

For auto-number fields, enter a Starting Number that is less than 1 billion. Check Generate Auto Number for existing records... if you would like to automatically number all current records beginning with the starting number you enter. If unchecked, the next record you enter will be assigned the starting number and your existing records will be blank in this field. For leads, only unconverted leads will be assigned a number. An auto-number field can contain up to 10 digits and up to 20 additional characters for your prefix or suffix.

share|improve this answer
1  
Good find Peter. Interesting to the say the least. –  Jesse Altman Jan 26 '13 at 17:57

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.