0

How do I assign "View all data" permissions to profile for the Organization Object Declaratively? The object doesn't appear on the profile objects permissions areas.

I'm trying to obtain the 18 digit org id from the Dev Console.

When I execute 'SELECT Id from Organization' from the Dev Console I get the message: sObject type 'Organization' is not supported. How can I correct this?

  • This is an x-y problem. If I recall correctly, all users should be able to query this object, though some fields are restricted to View All Data and Modify All Data users. – sfdcfox Apr 13 '18 at 20:54
  • Why do you want the Organization ID? Is it for use in Apex? In a trigger? In Process Builder? Workflow? Validation Rule? Something else? As @sfdcfox said, explaining the problem will help us suggest solutions. – DavidSchach Apr 13 '18 at 23:40
  • Its for an API interface. – Boots Apr 13 '18 at 23:43
2

Instead of querying for the OrganizationId, use the UserInfo class, which every user can access:

Id orgId = UserInfo.getOrganizationId();

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.