+ Start a Discussion

Autonumber Reset Seed Problem



I have just experienced an issue when resetting an autonumber field.


An object was created with an autonumber field and was tested in a live org for final user acceptance testing where several test entries were created.


I then carried out the following:


- Deleted the test entries ; ran an export using dataloader to prove they were gone.

- Reset the field ; changing the type to text and then back to autonumber count starting at 1.


However the following resulted: 


The first live record was created fine at 1 but then the next records were created 14, 15 etc.


Should I have emptied the recycle bin?  Or can anyone else suggest why the autonumber seed seems to have gone wrong?


Best wishes







Update after logging with Salesforce customer support - in case anyone else runs into this one.


My Apex test classes were creating test objects and although marked as testMethod the code increments the objects autonumber.


Customer support has now set it so that my org no longer updates the autonumbers in test classes.