function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
hemmhemm 

Is there meaning to an OrgId?

Given an org ID, are there things I can interpret from it? For example, I heard somewhere that character #4 referenced the instance someone is on (or maybe the one they were originally on). It'd at least be a way to determine production vs. sandbox.

 

Is there truth to that?

 

Are there other characters that have special meaning in an Org ID?

Best Answer chosen by Admin (Salesforce Developers) 
sfdcfoxsfdcfox

All SF ID values have the same meaning: XXXYZZZZZZZZZZZAAA, where XXX is the entity type, Y is the original server, ZZZZZZZZZZZ is the unique ID (case sensitive), and AAA is a checksum (used by the API for case-insensitive systems). AAA is optional and may be omitted as long as the casing is correct for the first 15 characters.

 

Before the days of migration, Y was reliably a number for a production server (ssl, naX, emea, ap, etc). When Sandbox was set up, Y was assigned a letter value instead of a number. When migrations started happening, it was decided that Y would never change, thus allowing older integrations that did not hard-code a login URL to work seamlessly without synchronizing all new ID values.

 

You can tell which server any record, not just the OrgID, originated from. Just look at the fourth character from the left--Y. The ZZZZZZZZZZZ value is assigned in incremental order, and has no other meaning attached to it, except to say that lower-valued records were created earlier than later-valued records.

All Answers

sfdcfoxsfdcfox

All SF ID values have the same meaning: XXXYZZZZZZZZZZZAAA, where XXX is the entity type, Y is the original server, ZZZZZZZZZZZ is the unique ID (case sensitive), and AAA is a checksum (used by the API for case-insensitive systems). AAA is optional and may be omitted as long as the casing is correct for the first 15 characters.

 

Before the days of migration, Y was reliably a number for a production server (ssl, naX, emea, ap, etc). When Sandbox was set up, Y was assigned a letter value instead of a number. When migrations started happening, it was decided that Y would never change, thus allowing older integrations that did not hard-code a login URL to work seamlessly without synchronizing all new ID values.

 

You can tell which server any record, not just the OrgID, originated from. Just look at the fourth character from the left--Y. The ZZZZZZZZZZZ value is assigned in incremental order, and has no other meaning attached to it, except to say that lower-valued records were created earlier than later-valued records.

This was selected as the best answer
hemmhemm

Curious if you know the Y value to instance translations for existing instances? NA1 = ?, NA2 = ? and so on

sfdcfoxsfdcfox

If I remember correctly, '0' is ssl (a.k.a. na0), '1' is emea, '2' is ap, '3' is na1, '4' is na2, '5' is na3, '6' is na4, '7' is na5... I'm not familiar with the newer servers, so I'm not sure which numbers and letters identify the other servers. tapp0 (a.k.a. cs0) should be 'S', cs1 should be 'T', and so on for the Sandbox servers. Again, I've not had a new sandbox in years, so I couldn't speculate what server ID values might be in use today.