function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

Invalid class: reportresults

I am exploring the analytic api introduced recently. While i am executing the code given in the developers guide i am getting an error message from developer console="Invalid class: reportresults"

// Get the report ID
List <Report> reportList = [SELECT Id,DeveloperName FROM Report where
    DeveloperName = 'Closed_Sales_This_Quarter'];
String reportId = (String)reportList.get(0).get('Id');

// Run the report
Reports.ReportResults results = Reports.ReportManager.runReport(reportId, true);
System.debug('Synchronous results: ' + results);

The code i am executing here is directly copied from developers guide. Please help me to recover from this error.

Hi George, 

Hi Andrew. Is your org a Spring ’14 org? If it is Winter ’14 you will not be able to use this code because the Analytics API in Apex is new for Spring ’14. I did all of this work in a pre-release org. You can sign up here if you want to experiment with features in Spring ’14.

Look fo rmore information on the Reports result class below,