Salesforce Dictionary - Free Salesforce GlossarySalesforce Dictionary
Full Auto Number entry
How-to guide

How to design an Auto Number that will not regret in three years

The setup is a one-click field create; the design is what determines whether the Auto Number serves the org for a decade or has to be replaced in year two. Most regret traces to under-sized digit counts, missing fiscal-year reset that was actually required, or formats that downstream integrations parsed assumptions into.

By Dipojjal Chakrabarti · Founder & Editor, Salesforce DictionaryLast updated May 18, 2026

The setup is a one-click field create; the design is what determines whether the Auto Number serves the org for a decade or has to be replaced in year two. Most regret traces to under-sized digit counts, missing fiscal-year reset that was actually required, or formats that downstream integrations parsed assumptions into.

  1. Decide the format with stakeholders before creating the field

    Loop in any downstream system owners. The format is an implicit contract; changing it later breaks integrations. Document the agreed format before opening Object Manager.

  2. Size the digit count for the expected lifetime

    Default to eight digits even if current volume is low. A {0000} pattern that rolls to five digits in year three produces ugly mixed-length sequences and breaks any parsing that assumed fixed width.

  3. Decide whether fiscal-year reset is required

    If yes, Auto Number is not the right pattern. Build a custom Text field plus a Flow or Apex that computes the value on insert. Document the choice.

  4. Create the Auto Number field in Object Manager

    Pick the object, Fields & Relationships, New, Auto Number. Enter the format and starting number. Save. Salesforce assigns the next value on the next insert.

  5. Backfill existing records if needed

    Auto Numbers do not retroactively populate. Use DataLoader or a Flow to assign values to existing records if the requirement covers backfill.

  6. Add the Auto Number to page layouts and list views

    Without the field on layouts, users see the meaningful reference number only in reports. Surface it prominently for high-reference objects (Cases, Orders).

  7. Document the format as an integration contract

    Add the format to your object documentation. Treat changes as breaking changes for downstream consumers; coordinate before modifying.

Display formatremember

Pattern with literal text and digit placeholder. Drives the user-facing reference number.

Starting numberremember

First value assigned. Default 1; can be set higher if migrating from an existing numbering system.

Digit countremember

Leading-zero padding. Size for expected lifetime volume; default to eight digits.

Reformat after creationremember

The format can be edited later, but only new records adopt the new format. Plan accordingly.

Backfill strategyremember

Whether and how existing records get values when the field is added to an established object.

Gotchas
  • Auto Numbers do not reset on calendar boundaries. Fiscal-year reset requires custom Apex or Flow; the platform feature does not support it declaratively.
  • Failed inserts consume sequence numbers. Auto Number is not gap-free; compliance contexts requiring gap-free numbering need custom Apex.
  • Under-sized digit counts produce ugly mixed-length sequences when they roll over. Default to eight digits even when volume is low.
  • Reformatting after creation does not update existing records. The org ends up with two visually distinct number patterns until existing records are updated.
  • Downstream integrations often parse Auto Number formats. Changing the format is a breaking change; document the format as a contract.

See the full Auto Number entry

Auto Number includes the definition, worked example, deep dive, related terms, and a quiz.