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
MJ09MJ09 

Tell from Org Id whether it's Production or a Sandbox

The LMA captures the Org Id associated with a License. Is there any way I can tell from that Org Id whether it's a Sandbox or Production? 

 

I've seen a few postings suggesting that you can, but when I check against a few known sandbox and Production Org Ids, the suggestions don't pan out. One such posting says, "The letter after "00D" determines the instance," and another says, "If the character after "00D" is a number, it's Production; if it's a letter, it's a sandbox," but I've seen exceptions to that. Specifically, I have a Developer Edition org that starts with 00DC, and another Developer Edition org that starts with 00D5.

 

Thanks!

Lorenzo AlaliLorenzo Alali
Posting for reference in case someone lands this forum question: $Organization.IsSandbox has been made available in the Summer '14 Release (https://resources.docs.salesforce.com/190/latest/en-us/sfdc/pdf/salesforce_summer14_release_notes.pdf).
Please Upvote this Idea (https://ideas.salesforce.com/s/idea/a0B8W00000GdavTUAR/organizationissandbox-global-variable-should-be-accessible-declaratively) to make is a global variable available natively in Flows, without having to work around this limitation with a Get Records from the Organization Object.