Just as the title asks, how do I set the startpoint for an autonumber after field creation? The field is an external Id and to avoid conflict with the external system, I need to move the id up a few numbers.
2 Answers
You can convert the field type to text, then convert it back to auto number. When you convert it back, you'll have the option to set the starting number again. I might do this after hours if there is a danger of a record being created while you're doing the field conversion.
https://help.salesforce.com/HTViewSolution?id=000005195&language=en_US
-
Note that this isn't possible for managed auto-number fields, where there's no way currently to force a specific value, since they can't be converted to text. Commented Oct 16, 2013 at 20:17
Changing the field type is a good idea. Alternately, if you're only going to move the auto-number up by a few numbers or even a few tens of numbers, you could insert some records and delete them. Crude but effective.
-
1This is the only time I don't mind that tests increment auto-number fields. If you can't or don't want to change the field type, you can run a test method that just inserts the number of records you need the auto-number moved up by. Then you don't actually have to create and delete records. Commented Aug 20, 2012 at 21:07
-
I was tempted to do this but there is a complex object hierarchy that would also have to be created. Commented Aug 21, 2012 at 13:58
[1...OPEN...10][11...FILLED...20][21...OPEN]
where there is a chunk of occupied Ids. I can't say why the data got into this state.