10

The Salesforce documentation details key fields being tracked in the History tables. However, I understand that the rows contain audit meta data including update / create datetime, user etc. Given that these fields are not in the documentation and I cannot run select * in SOQL statements against on the table. What is the recommended way to understand the full schema?

http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_objects_opportunityhistory.htm#topic-title

I've found what I'm looking for by using the APIGee Salesforce console and querying the REST API. Is there a better way?

https://apigee.com/console/salesforce

https://na14.salesforce.com/services/data/v27.0/sobjects/OpportunityHistory/describe

2 Answers 2

9

If you're on a Mac, I'm a huge fan of soqlXplorer: http://www.pocketsoap.com/osx/soqlx/

An OS-independent cloud-based option would be Workbench: https://workbench.developerforce.com/login.php

In Workbench, the Info tab for Standard & Custom objects should get you a good schema report.

5

There are a number of ways to get at this data. My usual method for a quick describe is to perform something like the following:

for(String field:
    Schema.OpportunityHistory.SObjectType.getDescribe().fields.getMap().keySet()) {
    System.debug(System.LoggingLevel.ERROR, field);
}

This can be executed directly from the Developer Console in your organization. Setting the log filters to all errors will give you a nicely formatted list without intervening rows. This works on all describable objects for which you have access. You can also run this from the Eclipse IDE using Execute Anonymous.

There's plenty of means of getting at this data, it's all about presentation. You could also just download an Enterprise WSDL if you wanted your information in XML format, or you could download the objects in the Eclipse IDE or Ant Migration Toolkit, as well. The Eclipse IDE method might be a bit easier to read, as the XML editor in Eclipse IDE is decent.

You must log in to answer this question.

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