4

This question already has an answer here:

I want to know where the source is to look all tables available to query. For example, a few months back I came to know we can query ApexClass, TestCoverage, etc.

SELECT Id, CreatedBy.Name FROM ApexClass
SELECT Id, RecordType.Name FROM RecordType

Is there a way I can know how many tables are available to query through SOQL?

marked as duplicate by martin, Mohith Shrivastava, Ratan Paul, Dave Humm, Lance Shi Feb 13 '17 at 23:38

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 1
    Have you done any research at all? Have you looked at any of the documentation? – Adrian Larson Feb 13 '17 at 3:49
  • No This is quite different question not a duplicate.This is different question with more dept of documentation the all tables and best way to fetch all aviliable tables in salesforce – David Mycka Feb 13 '17 at 6:20
  • But in this sfdcfox and javanoob gave awesome answers and way of explaining is also very good. Javanoob brought very good point of workbench. i think it will be helpful for other developers too. – David Mycka Feb 13 '17 at 6:24
  • I guess both questions should be helpful for any new developer looking for answers and help him – David Mycka Feb 13 '17 at 6:26
7

The SOAP API has a list of Standard Objects, hyperlinked to each object with a list of standard fields and a brief description of those fields, plus any "special rules" that may apply to portal users, queries, etc. In the event that this link somehow breaks, you can just search the Internet for "standard salesforce objects" and you should find it as one of the top organic (non-ad) search results.

  • That is what i want. You are awesome. I appreciate javanoob too for workbench – David Mycka Feb 13 '17 at 3:51
3

I usually go to workbench to find the list of Standard & Custom Objects that I can query in SOQL in my org.

But as mentioned by sfdcfox, the official documentation is very useful to understand how the standard field values are calculated for standard objects For ex: Opportunity Field Amount (You cannot just update this field value in all the cases. There are some gotchas).

enter image description here

  • 1
    I would like to thank you. But since i can only choose any one as best answers and Sfdcfox gave first, so just chosen that . But i really appreciate your answer too. Its a great GUI you told me. Thank you – David Mycka Feb 13 '17 at 3:52
  • @DavidMycka You are welcome. – javanoob Feb 13 '17 at 3:54
2

Access to standard objects depends from the features enabled in your organization. You can check what is available to your user right now by working with Schema and getGlobalDescribe() method. Following code executed in dev console will give you list of queryable objects for current user.

Map<String, Schema.SObjectType> gd = Schema.getGlobalDescribe();
for(Schema.SObjectType typeProcessed : gd.values()){
    if(typeProcessed.getDescribe().isQueryable()){
        system.debug(typeProcessed.getDescribe().getLocalName());
    }
}
  • Is there any way we can filter out standard and custom objects. I would like to see what others like RecordType, ApexClass etc are available to developer to query – David Mycka Feb 13 '17 at 3:46

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