Loading

Change the format of an auto number field on existing records

Publiceringsdatum: Jul 6, 2026
Beskrivning

When you change the display format of a custom auto-number field in Salesforce (for example, changing the prefix from 'CASE-{0000}' to 'SR-{00000}'), existing records retain their original formatted values. To apply the new format to existing records, you must temporarily convert the field to a Text type, update the values using Data Loader, and then convert it back to Auto-Number. This article provides step-by-step instructions for performing this update safely.

Lösning

Step 1: Convert the Auto-Number Field to Text

  • Change the field type from Auto-Number to Text. This step is required because Auto-Number fields are read-only and cannot be directly updated via the API or Data Loader.

Step 2: Export Existing Records Using Data Loader

  • Use the Data Loader to extract all records from the object, including the record Id's and the auto-number field in the export.
  • Open the export file in Excel and update the values in the auto-number column as desired.
  • Use the Data Loader to mass update the existing records using the file you have prepared.

Step 3: Convert the Field Back to Auto-Number

  • When converting back, set the Starting Number to a value higher than the highest existing auto-number on your records. This prevents Salesforce from generating duplicate auto-number values for future records


Ytterligare resurser

For more information you can also check the related article:

Knowledge-artikelnummer

000384794

 
Laddar
Salesforce Help | Article