Salesforce Dictionary - Free Salesforce GlossarySalesforce Dictionary
Salesforce Administrator
medium

What is an Auto-Number field and what should an admin watch out for?

An Auto-Number field generates a unique sequential number on record creation, formatted by a display mask: OPP-{0000} produces OPP-0001, OPP-0002, etc. The next number is stored on the field metadata and increments per insert.

What admins watch for:

  1. You can't roll back the counter in production. If you mass-import 50,000 test records and then delete them, the counter has still incremented — your next real record will be OPP-50001. Reset is a one-way street.
  2. Sandbox refresh copies the counter from production, so test imports in sandbox don't pollute production numbers — but failed sandbox loads still consume sandbox numbers, which can confuse UAT.
  3. Format changes — when you change the mask (e.g., OPP-{0000} to OPP-{00000}), Salesforce re-applies the new format only to new records. Existing records keep their old format. So OPP-00050 and OPP-051 could coexist. To re-format historical records you need a one-off Data Loader update.
  4. Auto-Number is not a primary key. It's just a display value. Salesforce's Id field is the actual unique identifier. Don't use Auto-Number for joins or lookups — use Id or an External ID custom field.
  5. You can manually reset the counter via Setup or a developer action — but it's destructive and rare. Use only after a clean-up where you've verified there are no lingering records.

Why this answer works

Tests whether the admin has hit the counter-pollution problem. Most have. The "format change doesn't backfill" detail and the "not a primary key" point are both classic mistakes admins make in their first year.

Follow-ups to expect

Related dictionary terms