+ Start a Discussion
MJ Kahn / OpFocusMJ Kahn / OpFocus 

Use Apex to tell what Salesforce Edition you're in

I'm developing a managed package that needs to behave differently depending on whether its installed in a Trial Edition org, a Developer Edition org, a Sandbox org, or a Production org. Is there any way that Apex can determine what type of Salesforce Edition or org it's running in?


(I know how to tell if it's a sandbox -- it's the other editions / org types that I need help with.)




You can query Organization for the OrganizationType field and the TrialExpirationDate to see if it's a trial. That's the only way I know of to get this level of detail.