how to access sandbox in salesforce code example
Example 1: how to find sandbox name in salesforce types
private static Boolean runningInASandbox() {
return [SELECT Id, IsSandbox FROM Organization LIMIT 1].IsSandbox;
}
Example 2: how to find sandbox name in salesforce types
SELECT Id, InstanceName, IsSandbox, Name, OrganizationType FROM Organization