4

For example, Account IDs have prefix 001 and have 15 alphanumeric digits. What are the values for the first and last records that can be represented in this format (as we understand Salesforce IDs today)?

Looking at some account ids ordered by id asc in my dev org it seems the ordering sorts by 0-9 then a-z then A-Z.

0010a00001ACeQl
0010a00001CVCfp
0010a00001CVCfq
0010a00001CVCfr
001j0000003ZS1z
001j0000003ZS20
001j0000003ZS21
001j0000003ZS22
001j0000003ZS23

Therefore my guess is the range is between 001000000000000 and 001ZZZZZZZZZZZZ

1

1 Answer 1

13

Most of what you need to know is covered in What are Salesforce ID's composed of?

In short, only the last 9 characters of the ID are incremented from record to record.

E.g.

0010a0000000001 to 0010a0ZZZZZZZZZ.

Giving you 629 possible identifiers for actual records on a pod for the same org.

The three characters immediately after the keyprefix has other purposes that are detailed in the linked question.

For the ordering, my experience with creating a large number of records in one go has been the following sequence:

0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz

I.e. numbers, upper case, then lower case.

See also:

2
  • Awesome, thanks!
    – Doug Ayers
    Commented Jul 3, 2017 at 6:18
  • Thanks @martin. Yes, it was a lowercase L rather than a 1. Fixed now. Commented Jul 3, 2017 at 6:18

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .