Linked Questions
10 questions linked to/from Can we determine if the Salesforce instance is production org or a Sandbox org?
124
votes
3
answers
122k
views
How can I efficiently generate a Set<Id> from a List<SObject> structure?
I have a bit of code where I've written a SOQL query that returns a list of SObject records, however I need a Set<Id> structure to pass to another method that I don't have control of (and thus ...
15
votes
2
answers
14k
views
NO_MASS_MAIL_PERMISSION Error from Unit Test on SingleMailMessage
I am currently working in a Config-Only sandbox. I have a unit test that is continually failing with the following error message:
System.EmailException: SendEmail failed. First exception on row 0;
...
5
votes
7
answers
6k
views
Differentiate Production/Sandbox Instance?
I know it is fairly straightforward in Apex to determine if the Salesforce instance is production org or a Sandbox org, but I wonder if the same is possible via formula? I have also read What are ...
12
votes
4
answers
4k
views
Converting the Salesforce Pod Id to ServerUrl/Name
Given a Salesforce Org Id, how can I determine the name and serverUrl to use with APIs?*
For example, given the Org Id 00DE00001234ooT I can get the Pod/Server identifier from the first character ...
10
votes
1
answer
4k
views
General way to distinguish different Org types?
I need to distinguish different Org type as follows
Production Org
Sandbox Org
Developer Org
Demo Org (created by Salesforce, sometimes called SDO - or created by partners, sometimes called PDO)
...
2
votes
3
answers
3k
views
Returning PageReferences from Init - Not working in sandbox
So either I'm going nuts, or I'm overlooking something obvious, or I'm just encountering some very weird behaviour.
The Setup
I have a page which calls an Init action in the controller from the page ...
7
votes
2
answers
1k
views
How do you prevent outbound messages from sandbox orgs as a 3rd party developer?
I have an app that sends outbound messages via workflow rules. When a customer makes a copy of their org as a sandbox I start getting outbound messages for that org as well. Is there a best practice ...
4
votes
2
answers
1k
views
Can production org ids ever change and if so, under what circumstances?
The inspiration for this question comes from an apparent requirement to hard-code a production org id. Is it safe to rely on the production org id always remaining the same?
Reason for hard-coding is ...
1
vote
1
answer
586
views
How to execute a class in Sandbox enviroment only, but have it on production as well?
I have created a couple of classes and a flow, that fill my sandbox with random data.
I want to have these classes available to all future sandboxes that I create, but I don't want to enable that ...
2
votes
1
answer
564
views
How do I identify whether a batch process was run from Production or testing?
I am setting up a result process based on batches and just wondered if there is a way to identify if the batch is run from the Production or Testing environment.