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
SetupForceSetupForce 

Autonumber Reset Seed Problem

Hi

 

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

Paul

 

http://twitter.com/setupforce

 

 

SetupForceSetupForce

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.

 

Paul

 

http://twitter.com/setupforce