8

What does is actually mean when a user can 'query' an Object?

In other words: what rights does a user have when the Object.isQueryable() returns True?

Pages like this only say that isQueryable returns whether the user can 'query' the object. But what does that mean?

2 Answers 2

11

isQueryable means the object is queryable as a top level object, e.g. you can do

select id from Foo__c

Some objects, e.g. Name are marked as isQueryable=false, and are only accessiable as a relationship from another object, so trying to do

select id from name

will return an error "entity type Name does not support query", but you can do

select who.name from event

(the polymorphic who relationship points to name during query)

5
  • And do rights come into play here? I see that I get isQueryable=false for a user with CRUD on a custom object and isQueryable=true for an admin, with the same CRUD rights on that custom object... Oct 27, 2014 at 18:51
  • No, rights have nothing to do with it.
    – superfell
    Oct 27, 2014 at 18:56
  • Ok. Could you come up with another explanation of the behaviour I get? I'm a little stuck there... Oct 28, 2014 at 9:24
  • Some objects are only directly queryable as a top level object if you're an admin (and so sharing checks can be skipped).
    – superfell
    Oct 28, 2014 at 14:35
  • This was with a custom object, so I would assume that is not the case here. But I'll look into that later. Thanks! Oct 28, 2014 at 21:18
-1

isQueryable() is used to check if application developers can carry out valid SOQL. Also it Returns true if the object can be queried by the current user, false otherwise.

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.