Record Name and display format in Salesforce Object creation

Page layouts, key lists, linked lists, lookups, and search results all include the Record Name. For example, the Record Name for Account is “Account Name”. When using the API, the Record Name field is always referred to as “Name.”

New Custom Objec 1 1

Text and Autonumber are two data types available.

If we choose Text, we must enter the record name while filling the record data. The system will not be made available automatically. This will be a mandatory field.

If we use the Auto Number type for the record name, we’ll be given a set of more mandatory fields: “Display format” and “Starting Number.”

New Custom Objec 2

Display Format:

With the Display Format, we can change the appearance of the Auto Number field. The substitution variables and other characters we can use as a prefix or suffix to make up a Display Format.

The Substitution Variables in Display Format are listed in the table below.

{0}Required The number of the sequence. The sequence number is represented by one or more zeros contained in curly braces. The minimum number of digits displayed is determined by the number of zeros in the curly braces. If the actual number has fewer digits than this, leading zeros will be inserted. The maximum number of digits is 10.
{YY}
{YYYY}
OptionalYear. The year of the record’s creation is represented by 2 or 4 “Y” characters wrapped in curly braces. The year can be displayed in two digits (for example, “08”) or all four digits (for example, “2008”).
{MM}
OptionalMonth. The numeric month of the record creation date (for example, “01” for January, “02” for February) is represented by two “M” characters surrounded in curly brackets.
{DD}
OptionalThe numeric day of the month (for example, “01” to “31” are valid days in January) of the record creation date is represented by two “D” characters surrounded in curly brackets.

The table below lists a few display formatted examples.

Display formatSequence NumberFormatted NumberComments
{0}1
250
5000
1
250
5000
No formatting. No leading zeros.

{000}1
250
5000
001
250
5000
The leading zeros have been padded to three digits.
{000000}1
250
5000
000001
000250
005000
The leading zeros have been padded to six digits.
{YYYY}{MM}-{0}1
250
5000
202111-1
202111-250
202111-5000
As a prefix to a number, a four-digit year and month are used.
PO# {00000000}1
250
5000
PO# 00000001
PO# 00000250
PO# 00005000
“PO# ” will be used as a prefix (including space.)
 A-{0000}1
250
5000
A-0001
A-0250
A-5000
“A-” will be used as a prefix.

Only records created after the change will be affected if you change the Display Format of an existing field.

Starting Number:

The sequence will begin with the number entered in the started number field.

Leave a Comment