I am trying to test "Using Scope" on a custom object, orders which has a MD relation to Account. I'm trying to filter a list view of Orders to show only by User's territory, like we have in Account list view option. I tried the following...

SELECT id, name FROM orders__c USING SCOPE MyTerritory

But it seems it's not the right way. Please guide me.


  • do u get any error when you run this soql ? – Vamsi Krishna Gosu Oct 3 '14 at 11:27
  • I ran on workbench soql. It didn't recognize after "SELECT id, name FROM orders__c" – MnZ Oct 3 '14 at 12:05
  • 1
    did you select version 32 in workbench ? – Vamsi Krishna Gosu Oct 3 '14 at 12:09
  • nope. let me check – MnZ Oct 3 '14 at 12:15
  • I chechked and found v32.0 is not supported. v31.0 is working though – MnZ Oct 3 '14 at 12:17

as you mentioned USING SCOPE is new with Winter 15 .. and you can use it with API version 32..

If you are using Workbench, select api version 32 when you login or change your api version to 32 in your session settings after you logged in to workbench and give it a try.. it should work..

when i run the below query in Developer Console in my sandbox which is Winter 15 I get the results fine..

Select Id from Account USING SCOPE Mine

but when i run the same query in Developer Console in production which is still Summer 14, i get an error saying unrecognised query ..

Note : I tried the same query with custom objects as well and it works fine in Winter 15 sandbox

| improve this answer | |
  • So you mean, if I use v32, I will be able to do SOQL query filtering on custom objects according to my Territory? No need to query accountshare,group and territory? – MnZ Oct 3 '14 at 12:55

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.