Skip to main content

SF-0025 · Concept · Medium

What are the different data types a standard record name field can have?

✓ Verified by Vikas Singhal · Last reviewed 5/17/2026

Every object in Salesforce has a Name field — the primary identifier shown in list views, related lists, search results, and lookup pickers. When you create a custom object, Salesforce asks you to pick the Name field’s data type. There are exactly two choices: Text or Auto Number.

Text

The Name is a free-text field, up to 80 characters, entered by the user when creating the record.

  • API name: still appears as Name regardless of label
  • Required: yes (by definition — every record needs a name)
  • Editable: yes
  • Searchable: yes — appears in global search and SOSL by default
  • Use when: humans naturally name the record — Account name, Contact name (well, technically Contact uses FirstName + LastName but the concept applies), Project name, Campaign name

The label can be anything (“Project Name”, “Invoice Title”) — only the data type is locked.

Auto Number

The Name is a system-generated sequence following a format you specify, with an automatically incrementing counter.

  • Display format: e.g., INV-{0000} → produces INV-0001, INV-0002, INV-0003
  • Starting number: you set this at creation (e.g., start at 1000)
  • Editable: no — users cannot type or change the value
  • Required: implicitly satisfied (the system always generates a value)
  • Searchable: yes
  • Use when: the record is referenced by ID more than by human name — Invoices, Cases (uses Auto Number standard), Orders, Service Requests, Tickets

Format string syntax

Inside the format, {0} is the running number with the digits determining the padded width. You can mix literal text, date tokens, and the number placeholder:

FormatSample output
INV-{0000}INV-0001
{YYYY}-{0000}2026-0001
CASE-{YYYY}{MM}-{00000}CASE-202605-00001
SR{0}SR1, SR2, …, SR10

Date tokens supported: {YYYY}, {YY}, {MM}, {DD}. The counter portion is a single {0...} placeholder with padding zeros.

Can you change the type later?

Yes — you can convert from Text to Auto Number (or vice versa) on a custom object’s Name field. But it’s destructive in spirit:

  • Text → Auto Number: existing record names are overwritten with the new generated values (the originals are lost unless you first copy them to another field).
  • Auto Number → Text: existing values stay as-is; users can now edit names. Future records aren’t auto-generated.

Most teams who guess wrong on day one wish they hadn’t. Decide thoughtfully.

A common pattern

For objects that need both a human-readable name and a deterministic ID, use:

  • Name = Auto Number (e.g., WO-{00000} → “WO-00123”)
  • A separate Text field called Title__c or Subject__c for the human-readable label

This is what standard Case does — CaseNumber is auto-number, Subject is the human title.

Standard objects with auto-number Names

Out of the box, several standard objects use auto-number-style identifiers:

  • Case.CaseNumber (system-generated, format configurable in Setup)
  • Solution.SolutionNumber
  • Order.OrderNumber
  • Contract.ContractNumber

For Account, Contact, Lead, Opportunity, etc., the Name is a Text field.

Verified against: Salesforce Help — Define a Custom Object and Auto Number Field Type. Last reviewed 2026-05-17.