8

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)?

16

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 highest that you can start with 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 Starting Number entry.

For auto-number fields, enter a Starting Number that’s less than 1 billion. [...] An auto-number field can contain up to 10 digits and up to 20 additional characters for your prefix or suffix.

  • 1
    Good find Peter. Interesting to the say the least. – Jesse Altman Jan 26 '13 at 17:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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