[SalesForce] How does the field type “Auto Number” calculate

I'm looking for the formula used by Salesforce on Data Type: Auto Number fields.

I assumed it was sequential (increases by 1 from the last number generated), but according to our data, it doesn't seem true:

Record created 7:32 AM = 0003288395; Record created 9:06 AM = 0003289295. An hour an a half later and the number is 900 higher. According to a report of all records created and sorted by this number field, there are no numbers in between them unless 900 records were deleted – which I confirmed is not the case in our Recycle Bin.

Best Answer

If you run test methods, and don't opt to preserve sequencing (it's in the test running page under the options button), any tests you run will cause gaps. Also, failed transactions can cause gaps unless you enable the anti-gap function available by contacting support.

Related Topic