Data Export from Salesforce Developer Console
Developer Console is a very useful tool, but at time of this writing you cannot easily do a data export from it. There is a (kind of) easy workaround using “Inspect Element” of Google Chrome. Those steps follow.
Steps to Export Data from Developer Console Query Results
- First, run the query that generates the data of interest using Google Chrome. Note that
ApexCodeCoverage
andApexCodeCoverageAggregate
in particular are only available via the Tooling API, which can be queried from the Developer Console. The following queries may be helpful.
SELECT Id, ApexTestClassId, TestMethodName, ApexClassorTriggerId,
NumLinesCovered, NumLinesUncovered, Coverage
FROM ApexCodeCoverage
SELECT ApexClassorTriggerId, NumLinesCovered, NumLinesUncovered, Coverage
FROM ApexCodeCoverageAggregate
SELECT Id, NamespacePrefix, Name, ApiVersion, Status, IsValid, BodyCrc,
Body, LengthWithoutComments, CreatedDate, CreatedById, LastModifiedDate,
LastModifiedById, SystemModstamp
FROM ApexClass
- Then, right-click on the data, then “Inspect.”
- Look through the resulting Inspect Window to find the
div
withsoqlgrid-
followed by a few numbers. Right-click it, then “Copy,” then “Copy element.” Paste it into Excel. If that doesn’t work (the result may be HTML), try “Copy element” on thediv
withgridview-
followed by a few numbers.
Note that pasting it into other programs, like a plain text file or Google Sheets, may yield HTML. Try Excel.