Feature Addition

35 views
Skip to first unread message

tushar...@gmail.com

unread,
Aug 19, 2012, 11:18:31 PM8/19/12
to forcewo...@googlegroups.com
  • Export Object Schema as CSV File 
  • Predefined Query like RecordCount , desire output , count of records across all objects.
     

Ryan Brainard

unread,
Aug 22, 2012, 12:13:19 AM8/22/12
to forcewo...@googlegroups.com, tushar...@gmail.com
Thank your for your suggestions. See comments inline below:


On Sunday, August 19, 2012 8:18:31 PM UTC-7, tushar...@gmail.com wrote:
  • Export Object Schema as CSV File 
The problem with this is that schema is not really two dimensional. Can you offer more detail of what you're looking for? Does this request capture it?    
  • Predefined Query like RecordCount , desire output , count of records across all objects.
Not exactly sure what you mean here. The query builder supports "count()" queries, but is only for a single object to reflect what the API supports. If you want the total of all record counts, you can do something like this in Apex Execute in Workbench:

Integer totalCount = 0;
for (String type : Schema.getGlobalDescribe().keyset()) {
    try {
        Integer typeCount = Database.countQuery('SELECT count() FROM ' + type);
        System.debug(type + ': ' + typeCount);
        totalCount += typeCount;
    } catch (System.QueryException e){
        // some objects are special cased. a better impl would need to handle these.
        System.debug(e);
    }

    if (Limits.getQueries() >= Limits.getLimitQueries()) {
        System.debug('WARNING: Aborting early as to not hit governor limits');
        break; 
    }
}
System.debug('TOTAL: ' + totalCount); 


 

Ryan Brainard

unread,
Aug 22, 2012, 12:19:52 AM8/22/12
to forcewo...@googlegroups.com, tushar...@gmail.com
Looks like I forgot to paste the link to the existing feature request regarding your first suggestion. Here it is:
Reply all
Reply to author
Forward
0 new messages