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?

3
  • 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, 2018 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. Apr 13, 2018 at 23:40
  • Its for an API interface.
    – Boots
    Apr 13, 2018 at 23:43

1 Answer 1

2

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

Id orgId = UserInfo.getOrganizationId();

You must log in to answer this question.

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