0

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 1

0

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;
5
  • there is a field Environment hub org id in my sandbox on company information page,but unable to soql it
    – ramesh
    Commented 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 C
    Commented 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.
    – ramesh
    Commented May 26, 2017 at 9:49
  • just tell me , how can i get it?
    – ramesh
    Commented May 27, 2017 at 14:19
  • @ramesh If I knew I would include that in the answer...
    – Keith C
    Commented May 27, 2017 at 16:16

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .