how to get Environment hub org id in salesforce using soql and its use to prevent some information to be copied from production to sandbox.
1 Answer
I don't see a field for that on the Organization
object or the UserInfo
class.
You can detect if you are in a sandbox or not using:
Boolean isSandbox = [select IsSandbox from Organization limit 1].IsSandbox;
-
there is a field Environment hub org id in my sandbox on company information page,but unable to soql it– rameshCommented May 26, 2017 at 9:32
-
@ramesh Yeah I've seen that field in the UI too. Perhaps you can add explanation to your question of exactly why you need it versus using other mechanisms.– Keith CCommented May 26, 2017 at 9:40
-
This id is common in sandboxes and production.So need it to prevent some information to be copied from production to sandbox.– rameshCommented May 26, 2017 at 9:49
-
-